Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
import java.time.format.TextStyle;
import java.util.Locale;

public class Main {
    public static void main(String[] args) {
        LocalDate localDate = LocalDate.of(2014, Month.JUNE, 21);
        DayOfWeek dayOfWeek = DayOfWeek.from(localDate);
        System.out.println(dayOfWeek.getDisplayName(TextStyle.FULL, Locale.CANADA));
        System.out.println(dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.CANADA));
        System.out.println(dayOfWeek.getDisplayName(TextStyle.NARROW, Locale.CANADA));
    }
}