MonthDay of(int month, int dayOfMonth) example

Description

MonthDay of(int month, int dayOfMonth) creates an instance of MonthDay.

Syntax

of has the following syntax.


public static MonthDay of(int month,   int dayOfMonth)

Example

The following example shows how to use of.


import java.time.MonthDay;
/*ww w  .j a  va 2 s  . c  om*/
public class Main {
  public static void main(String[] args) {
    MonthDay m = MonthDay.of(1,21);

    System.out.println(m);

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset