Vijay Tidake wrote:System.out.println(cal.getTime().getDay());[/code]
Hope this helps
Not really.
cal.getTime() returns a Date object, and Date.getDay() is deprecated and should not be used. You already have a Calendar object, use that. So once you have that, use
cal.get(Calendar.DAY_OF_WEEK).
As for the return value, compare that to the constants Calendar.SUNDAY, Calendar.MONDAY, ..., Calendar.SATURDAY. These are valued from 1 to 7, but your code will be more readable and less error-prone.