Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDate;
import java.time.Month;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.TextStyle;
import java.time.temporal.ChronoField;

public class Main {

    public static void main(String[] args) {
        DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendLiteral("New Year in ")
                .appendValue(ChronoField.YEAR).appendLiteral(" is  on  ")
                .appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL_STANDALONE).toFormatter();
        LocalDate ld = LocalDate.of(2014, Month.JANUARY, 1);
        String str = ld.format(formatter);
        System.out.println(str);

    }
}