Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDate;
import java.time.Month;

public class Main {
    public static void main(String[] args) {
        LocalDate localDate = LocalDate.of(2014, Month.AUGUST, 3);
        System.out.println(localDate);
        Month month1 = Month.from(localDate);
        System.out.println(month1);

        Month month2 = Month.of(2);
        System.out.println(month2);

        Month month3 = month2.plus(2);
        System.out.println(month3);

        Month month4 = localDate.getMonth();
        System.out.println(month4);

        int monthIntValue = month2.getValue();
        System.out.println(monthIntValue);
    }
}