FileDocCategorySizeDatePackage
DaysOfTheWeek.javaAPI DocExample835Sun Jan 07 15:15:00 GMT 2001None

DaysOfTheWeek

public class DaysOfTheWeek extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)


    Locale usersLocale;

    if (argv.length == 2)
      usersLocale = new Locale(argv[0], argv[1]);
    else if (argv.length == 3)
      usersLocale = new Locale(argv[0], argv[1], argv[2]);
    else
      usersLocale = Locale.getDefault();

    DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);
    String weekdays[] = dfs.getWeekdays();

    Calendar cal = Calendar.getInstance(usersLocale);

    int firstDayOfWeek = cal.getFirstDayOfWeek();
    int dayOfWeek;

    for (dayOfWeek = firstDayOfWeek; dayOfWeek < weekdays.length; dayOfWeek++)
      System.out.println(weekdays[dayOfWeek]);

    for (dayOfWeek = 0; dayOfWeek < firstDayOfWeek; dayOfWeek++)
      System.out.println(weekdays[dayOfWeek]);