如果使用
GregorianCalendar,则可以执行以下操作
确定给定年份是否为is年。如果给定的年份是a年,则返回true。要指定BC年号,必须提供1年号。例如,BC 4年被指定为-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.");}


