Java Date Time - LocalDate of(int year, int month, int dayOfMonth) example








LocalDate of(int year, int month, int dayOfMonth) creates an instance of LocalDate from a year, month and day.

Syntax

of has the following syntax.

public static LocalDate of(int year,   int month,   int dayOfMonth)

Example

The following example shows how to use of.

import java.time.LocalDate;

public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014,10,10);
    
    System.out.println(a);
  }
}

The code above generates the following result.