If you use the GregorianCalendar, you could do as below
Determines if the given year is a leap year. Returns true if the given
year is a leap year. To specify BC year numbers, 1 - year number must
be given. For example, year BC 4 is specified as -3.
GregorianCalendar cal = new GregorianCalendar();
if(cal.isLeapYear(year))
{
System.out.print("Given year is leap year.");
}
else
{
System.out.print("Given year is not leap year.");
}