Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { /** * Returns <tt>true</tt> if the two given calendars are dated on the same year. * @param one The one calendar. * @param two The other calendar. * @return True if the two given calendars are dated on the same year. */ public static boolean sameYear(Calendar one, Calendar two) { return one.get(Calendar.YEAR) == two.get(Calendar.YEAR); } }