List of usage examples for java.time Year parse
public static Year parse(CharSequence text, DateTimeFormatter formatter)
From source file:Main.java
public static void main(String[] args) { Year y = Year.parse("2014", DateTimeFormatter.ofPattern("yyyy")); System.out.println(y);// w ww . j ava 2 s . c o m }