Here you can find the source of getMonthOfNextQuarter(String yearAndMonth)
public static String getMonthOfNextQuarter(String yearAndMonth)
//package com.java2s; //License from project: Open Source License public class Main { public static String getMonthOfNextQuarter(String yearAndMonth) { int year = Integer.parseInt(yearAndMonth.substring(0, 4)); int mon = Integer.parseInt(yearAndMonth.substring(4, 6)); String nextmonth = ""; String nextyear = String.valueOf(year); if (mon == 10) { nextmonth = "01"; nextyear = String.valueOf(year + 1); } else if (mon == 11) { nextmonth = "02"; nextyear = String.valueOf(year + 1); } else if (mon == 12) { nextmonth = "03"; nextyear = String.valueOf(year + 1); } else if (mon < 7) { nextmonth = "0" + String.valueOf(mon + 3); } else {//from ww w . ja va 2 s .c o m nextmonth = String.valueOf(mon + 3); } return nextyear + nextmonth; } }