You are viewing a single comment's thread. Return to all comments →
For Java 15:
private static boolean isLeap(int year){ if(year < 1918){ return year % 4 == 0; } return (year % 400 == 0) || (year%4==0 && year%100!=0); } public static String dayOfProgrammer(int year) { if(year == 1918){ return "26.09."+year; } if(isLeap(year)){ return "12.09."+year; } else { return "13.09."+year; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day of the Programmer
You are viewing a single comment's thread. Return to all comments →
For Java 15: