Here you can find the source of getNextMonth(String month)
public static String getNextMonth(String month)
//package com.java2s; //License from project: Open Source License public class Main { public static String getNextMonth(String month) { int year = Integer.parseInt(month.substring(0, 4)); int mon = Integer.parseInt(month.substring(4, 6)); String nextmonth = ""; String nextyear = String.valueOf(year); if (mon == 12) { nextmonth = "01"; nextyear = String.valueOf(year + 1); } else if (mon < 9) { nextmonth = "0" + String.valueOf(mon + 1); } else {/*from www.j a v a 2 s . com*/ nextmonth = String.valueOf(mon + 1); } return nextyear + nextmonth; } }