Java MonthDay create

Description

Java MonthDay create

import java.time.Month;
import java.time.MonthDay;

public class Main {
  public static void main(String[] args) {
    MonthDay monthDay = MonthDay.now();
    System.out.println("Current month and day: " + monthDay);

    monthDay = MonthDay.of(Month.NOVEMBER, 11);
    System.out.println("Specified Month-Day: " + monthDay);

  }//  w w w  .j a va2  s.  c  o  m

}



PreviousNext

Related