|
Java™ by example!
|
|
|
How do I determine whether a particular year is a leap year?
The rule is that all years divisible by 4 are leap years. An exception is when the year is divisible by 100 unless the year is also divisible by 400. On a GreorianCalendar instance, you can invoke the method isLeapYear. Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|