I could calculate the number of weeks in any month and year using following method.
public void calWeeksAndDays(int month, in year)
GregorianCalendar cal = new GregorianCalendar(year, month, 1);
int weeks = cal.getActualMaximum(WEEK_OF_MONTH);
This works as expected, but now how do I figure out how many days are in each of the weeks that I got from above?