Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDate;
import java.time.Year;

public class Main {

    public static void main(String[] args) {
        LocalDate date = LocalDate.of(2014, 2, 15); // 2014-02-15
        System.out.println(date.getYear()); // 2014
        System.out.println(date.getDayOfYear()); // 46
        System.out.println(date.lengthOfYear()); // 365
        System.out.println(date.isLeapYear()); // false

        Year year_2014 = Year.of(2014);
        System.out.println(year_2014.isLeap()); // false
    }
}