Java Week Day getWeekDayStr(int dayInWeek)

Here you can find the source of getWeekDayStr(int dayInWeek)

Description

get Week Day Str

License

Open Source License

Declaration

public static String getWeekDayStr(int dayInWeek) 

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    public static String getWeekDayStr(int dayInWeek) {
        StringBuffer dateStr = new StringBuffer();
        switch (dayInWeek) {
        case Calendar.MONDAY:
            dateStr.append("Monday");
            break;
        case Calendar.TUESDAY:
            dateStr.append("Tuesday");
            break;
        case Calendar.WEDNESDAY:
            dateStr.append("Wednesday");
            break;
        case Calendar.THURSDAY:
            dateStr.append("Thursday");
            break;
        case Calendar.FRIDAY:
            dateStr.append("Friday");
            break;
        case Calendar.SATURDAY:
            dateStr.append("Saturday");
            break;
        case Calendar.SUNDAY:
            dateStr.append("Sunday");
            break;
        }//  w  w  w  .jav a 2 s  . com
        return dateStr.toString();
    }
}

Related

  1. getWeekdayNames()
  2. getWeekdayNames(Locale locale)
  3. getWeekDayNUM()
  4. getWeekdayOfDateTime(String datetime)
  5. getWeekdays(DateFormatSymbols symbols)
  6. getWeekendDays(Locale locale)
  7. getWeekFirstDay(Date date)
  8. isDayOfWeek(int day)
  9. isDayOfWeek(String str, int dayOfWeek)