Example usage for java.time MonthDay withDayOfMonth

List of usage examples for java.time MonthDay withDayOfMonth

Introduction

In this page you can find the example usage for java.time MonthDay withDayOfMonth.

Prototype

public MonthDay withDayOfMonth(int dayOfMonth) 

Source Link

Document

Returns a copy of this MonthDay with the day-of-month altered.

Usage

From source file:Main.java

public static void main(String[] args) {
    MonthDay m = MonthDay.now();
    MonthDay n = m.withDayOfMonth(21);
    System.out.println(n);//ww w  . j av a 2s  .co  m

}