Here you can find the source of sameYear(Calendar one, Calendar two)
Parameter | Description |
---|---|
one | The one calendar. |
two | The other calendar. |
public static boolean sameYear(Calendar one, Calendar two)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { /**/*from w w w .jav a2 s.c om*/ * 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); } }