Here you can find the source of getYear(Calendar c)
public static int getYear(Calendar c)
//package com.java2s; import java.util.Calendar; public class Main { public static int getYear(Calendar c) { if (c != null) { return c.get(Calendar.YEAR); } else {/* ww w . ja v a 2 s. com*/ return Calendar.getInstance().get(Calendar.YEAR); } } }