Example usage for java.time YearMonth plus

List of usage examples for java.time YearMonth plus

Introduction

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

Prototype

@Override
public YearMonth plus(TemporalAmount amountToAdd) 

Source Link

Document

Returns a copy of this year-month with the specified amount added.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    YearMonth s = y.plus(Period.ofYears(3));
    System.out.println(s);// w  ww.j a  v a 2  s  .c o  m

}