Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Main {

    public static void main(String[] args) {
        LocalDate ld1 = LocalDate.parse("2014-06-10");
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
        LocalDate ld2 = LocalDate.parse("06/10/2014", formatter);

        System.out.println("ld1: " + ld1);
        System.out.println("ld2: " + ld2);
    }
}