import java.text.ParseException;
public class MainClass {
public static void main(String[] args) throws ParseException {
System.out.println(isLeapYear(2000));
}
public static boolean isLeapYear(int year) {
if (year < 0) {
return false;
}
if (year % 400 == 0) {
return true;
} else if (year % 100 == 0) {
return false;
} else if (year % 4 == 0) {
return true;
} else {
return false;
}
}
}
|