Calendar.MONDAY : Calendar « java.util « Java by API






Calendar.MONDAY

   
/**
 *Output:

THURSDAY
 */

import java.util.Calendar;
import java.util.Date;

public class MainClass {
  public static void main(String args[]) {
    Calendar cal = Calendar.getInstance();
    Date now = new Date();
    cal.setTime(now);
    int dayofweek = cal.get(Calendar.DAY_OF_WEEK);
    if (dayofweek == Calendar.SUNDAY)
      System.out.println("SUNDAY");
    if (dayofweek == Calendar.MONDAY)
      System.out.println("MONDAY");
    if (dayofweek == Calendar.TUESDAY)
      System.out.println("TUESDAY");
    if (dayofweek == Calendar.WEDNESDAY)
      System.out.println("WEDNESDAY");
    if (dayofweek == Calendar.THURSDAY)
      System.out.println("THURSDAY");
    if (dayofweek == Calendar.FRIDAY)
      System.out.println("FRIDAY");
    if (dayofweek == Calendar.SATURDAY) {
      System.out.println("SATURDAY");
    }
  }
}

           
         
    
    
  








Related examples in the same category

1.Calendar.AM_PM
2.Calendar.DATE
3.Calendar.DAY_OF_WEEK_IN_MONTH
4.Calendar: DAY_OF_WEEK
5.Calendar.DAY_OF_YEAR
6.Calendar.DST_OFFSET
7.Calendar.ERA
8.Calendar.HOUR
9.Calendar.HOUR_OF_DAY
10.Calendar.MILLISECOND
11.Calendar.MINUTE
12.Calendar: TUESDAY
13.Calendar.SECOND
14.Calendar.SUNDAY
15.Calendar.WEEK_OF_MONTH
16.Calendar.WEEK_OF_YEAR
17.Calendar.YEAR
18.Calendar.ZONE_OFFSET
19.Calendar: add(int field, int amount)
20.Calendar: after(Object when)
21.Calendar: before(Object when)
22.Calendar: int get(int field)
23.Calendar: getActualMaximum(int field)
24.Calendar: getDisplayNames(int field, int style, Locale locale)
25.Calendar: getFirstDayOfWeek()
26.Calendar: getInstance()
27.Calendar: getTime()
28.Calendar: set(int field, int value)
29.Calendar: set(int year, int month, int date)
30.Calendar: setTime(Date date)
31.Calendar: setTimeInMillis(long millis)