Example usage for java.time YearMonth withMonth

List of usage examples for java.time YearMonth withMonth

Introduction

In this page you can find the example usage for java.time YearMonth withMonth.

Prototype

public YearMonth withMonth(int month) 

Source Link

Document

Returns a copy of this YearMonth with the month-of-year altered.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    YearMonth s = y.withMonth(3);
    System.out.println(s);//from w  w  w .j  a  va 2s  .  c o m

}