Example usage for java.time Period withYears

List of usage examples for java.time Period withYears

Introduction

In this page you can find the example usage for java.time Period withYears.

Prototype

public Period withYears(int years) 

Source Link

Document

Returns a copy of this period with the specified amount of years.

Usage

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofMonths(1);

    Period l = p.withYears(10);
    System.out.println(l);/*from w ww .  j a v a 2  s .  c  o m*/

}