Here you can find the source of getCurrentYear()
public static int getCurrentYear()
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { private static final Calendar CALENDAR = new GregorianCalendar(); public static int getCurrentYear() { CALENDAR.setTime(new Date()); return CALENDAR.get(Calendar.YEAR); }/*w w w. j a v a 2 s. c o m*/ }