Example usage for java.time Year parse

List of usage examples for java.time Year parse

Introduction

In this page you can find the example usage for java.time Year parse.

Prototype

public static Year parse(CharSequence text, DateTimeFormatter formatter) 

Source Link

Document

Obtains an instance of Year from a text string using a specific formatter.

Usage

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

}