programming-examples/java/_Basics/How to display name of the weekdays.java

11 lines
386 B
Java
Raw Normal View History

2019-11-15 12:59:38 +01:00
import java.text.SimpleDateFormat;
import java.text.DateFormatSymbols;
public class Main {
public static void main(String[] args) {
String[] weekdays = new DateFormatSymbols().getWeekdays();
for (int i = 2; i < (weekdays.length-1); i++) {
String weekday = weekdays[i];
System.out.println("weekday = " + weekday);
}
}
}