• + 0 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;
        }
    }