Here you can find the source of getMonth(Calendar c)
public static int getMonth(Calendar c)
//package com.java2s; import java.util.Calendar; public class Main { public static int getMonth(Calendar c) { if (c != null) { return c.get(Calendar.MONTH); } else {//from ww w . ja va2 s . c o m return Calendar.getInstance().get(Calendar.MONTH); } } }