Example usage for java.time YearMonth get

List of usage examples for java.time YearMonth get

Introduction

In this page you can find the example usage for java.time YearMonth get.

Prototype

@Override 
public int get(TemporalField field) 

Source Link

Document

Gets the value of the specified field from this year-month as an int .

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    long m = y.get(ChronoField.YEAR);
    System.out.println(m);// w w  w  .  j  a va  2s . c  om

}