public class Sample {
public static void main(String[] args) {
int year = 2012;
// put the month you want
int month = Calendar.MARCH;
Calendar cal = new GregorianCalendar(year, month, 1);
do {
int day = cal.get(Calendar.DAY_OF_WEEK);
if (day == Calendar.SATURDAY || day == Calendar.SUNDAY) {
System.out.println(cal.get(Calendar.DAY_OF_MONTH));
}
cal.add(Calendar.DAY_OF_YEAR, 1);
} while (cal.get(Calendar.MONTH) == month);
}
By the above code i am getting all saturdays and sundays in a given month .I want store all these days in an array and the other days in another String array.
Not sure what you mean by reaming days, but if I understand the first part of your question correctly, this should work: