Java Data Type How to - Create a simple Date - Henry VIII Birthday - June 28th 1491








Question

We would like to know how to create a simple Date - Henry VIII Birthday - June 28th 1491.

Answer

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

public class Main {
  public static void main(String[] argv) {
    LocalDate d = LocalDate.of(1491, Month.JUNE, 28);
    System.out.println(d);
  }
}

The code above generates the following result.