Java Day Name getDayName(int i)

Here you can find the source of getDayName(int i)

Description

get Day Name

License

Open Source License

Declaration

public static String getDayName(int i) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {

    public static String getDayName(int i) {
        String dayname = "";
        switch (i) {
        case Calendar.MONDAY:
            dayname = "M";
            break;
        case Calendar.TUESDAY:
            dayname = "T";
            break;
        case Calendar.WEDNESDAY:
            dayname = "W";
            break;
        case Calendar.THURSDAY:
            dayname = "T";
            break;
        case Calendar.FRIDAY:
            dayname = "F";
            break;
        case Calendar.SATURDAY:
            dayname = "S";
            break;
        case Calendar.SUNDAY:
            dayname = "S";
            break;
        default:// w w w . j  a v a2 s .com
            break;
        }
        return dayname;
    }
}

Related

  1. dayName(String dayNumber)
  2. dayName(String dayNumber)
  3. getCurrentDayName()
  4. getDayName()
  5. getDayName(String code)
  6. getDayOfWeekName(int dayOfWeek)
  7. parseDayName(String twoLetterDayName)