Java Date Time Java Java API
java.time.Year
public int getValue()
Returns the year value as int from this Year object.
package com.logicbig.example.year;import java.time.Year;public class GetValueExample { public static void main(String... args) { Year y = Year.now(); System.out.println(y); int value = y.getValue(); System.out.println(value); }}
20172017