Here you can find the source of issueMonth(int issue1, int issue2)
public static int[] issueMonth(int issue1, int issue2)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] issueMonth(int issue1, int issue2) { int k = issue1; issue1 = k >= issue2 ? k : issue2; issue2 = k < issue2 ? k : issue2; int months = issueMonthNum(issue1, issue2); int[] intArray = new int[months + 1]; intArray[0] = issue2;//from w ww. j a v a2s .c om intArray[months] = issue1; int year = issue2 / 100; int month = issue2 % 100; for (int i = 1; i < months; i++) { month++; if (month > 12) { year++; month = 1; } intArray[i] = Integer.valueOf("" + year + (month < 10 ? "0" + month : month)); } return intArray; } public static int issueMonthNum(int issue1, int issue2) { int k = issue1; issue1 = k >= issue2 ? k : issue2; issue2 = k < issue2 ? k : issue2; int yearnum = issue1 / 100 - issue2 / 100; int monthnum = issue1 % 100 - issue2 % 100; if (monthnum < 0) return 12 * (yearnum - 1) + (12 + monthnum); else if (monthnum > 0) return 12 * yearnum + monthnum; else return 12 * yearnum; } }