Last day in February in a leap year in Java
Description
The following code shows how to last day in February in a leap year.
Example
/* w w w . j ava 2 s . c om*/
import java.util.Calendar;
import java.util.GregorianCalendar;
public class Main {
public static void main(String[] argv) throws Exception {
Calendar cal = new GregorianCalendar(2000, Calendar.FEBRUARY, 1);
int days = cal.getActualMaximum(Calendar.DAY_OF_MONTH); // 29
}
}