Java Date Time Java Java API
java.time.LocalDate
public int getYear()
Returns the int value for the year.
int
package com.logicbig.example.localdate;import java.time.LocalDate;public class GetYearExample { public static void main (String... args) { LocalDate d = LocalDate.of(1980, 3, 22) .plusDays(3000); int year = d.getYear(); System.out.println(year); }}
1988