Here you can find the source of addMonth(Date date, int month)
@SuppressWarnings("deprecation") public static Date addMonth(Date date, int month)
//package com.java2s; import java.util.*; public class Main { @SuppressWarnings("deprecation") public static Date addMonth(Date date, int month) { Date retDate = (Date) date.clone(); retDate.setMonth(retDate.getMonth() + month); return retDate; }//from ww w .j ava 2 s . c om public static int getMonth(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date); int month = cal.get(Calendar.MONTH); return (month + 1); } }