Java Date Time Java Java API
java.time.Year
public Year plusYears(long yearsToAdd)
Returns a copy of this Year with the specified number of years added.
Year
package com.logicbig.example.year;import java.time.Year;public class PlusYearsExample { public static void main(String... args) { Year y = Year.of(2011); System.out.println(y); Year y2 = y.plusYears(50); System.out.println(y2); Year y3 = y.plusYears(-50); System.out.println(y3); }}
201120611961