Get a List of Weekday Names in Java

Description

The following code shows how to get a List of Weekday Names.

Example


//from   w  ww . j av  a2  s  .  c o  m
import java.text.DateFormatSymbols;

public class Main {
  public static void main(String[] args) {
    String[] weekdays = new DateFormatSymbols().getWeekdays();
    for (int i = 0; i < weekdays.length; i++) {
      String weekday = weekdays[i];
      System.out.println("weekday = " + weekday);
    }

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Date »




Date Get
Date Set
Date Format
Date Compare
Date Convert
Date Calculation
Date Parse
Timezone