The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.util  [50 examples] > Dates  [7 examples]

e378. Determining If a Year Is a Leap Year

    GregorianCalendar cal = new GregorianCalendar();
    boolean b = cal.isLeapYear(1998); // false
    b = cal.isLeapYear(2000);         // true
    b = cal.isLeapYear(0);            // true

 Related Examples
e373. Getting the Current Date
e374. Creating a Date Object for a Particular Date
e375. Determining the Number of Days in a Month
e376. Comparing Dates
e377. Determining a Person's Age
e379. Determining the Day-of-Week for a Particular Date

See also: Arrays    Bits    Collections    Hash Tables    Lists    Property Files    Sets    Sorted Collections    Time    Timers   


© 2002 Addison-Wesley.