Example usage for java.time YearMonth plusYears

List of usage examples for java.time YearMonth plusYears

Introduction

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

Prototype

public YearMonth plusYears(long yearsToAdd) 

Source Link

Document

Returns a copy of this YearMonth with the specified number of years added.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    YearMonth s = y.plusYears(3);
    System.out.println(s);//from  www . ja va2s.c o m

}