我怎样才能得到特定月份和特定年份的所有日子..
答案 0 :(得分:3)
Calendar cal = Calendar.getInstance();
cal.set(Calendar.MONTH,someMonth);//month starts from 0
cal.set(Calendar.YEAR,someYear);
int noOfDayInMonthyear = cal.getActualMaximum(Calendar.DAY_OF_MONTH); //either 28,29,30,31
并从1迭代到noOfDayInMonthyear