Java YearMonth create

Description

Java YearMonth create

import java.time.Month;
import java.time.YearMonth;

public class Main {
    public static void main(String[] args) {
        YearMonth yearMo = YearMonth.now();
        System.out.println("Current Year and month:" + yearMo);
        /* w  w  w.j a  v  a2 s  . co m*/
        YearMonth specifiedDate = YearMonth.of(2000, Month.NOVEMBER);
        System.out.println("Specified Year-Month: " + specifiedDate);

    }
   
}



PreviousNext

Related