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 { public static int getCurrentYear() { Calendar calendar = new GregorianCalendar(); calendar.setTime(new Date()); return calendar.get(Calendar.YEAR); }/*from ww w . j av a 2 s.com*/ }