Example usage for java.time YearMonth isSupported

List of usage examples for java.time YearMonth isSupported

Introduction

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

Prototype

@Override
public boolean isSupported(TemporalUnit unit) 

Source Link

Document

Checks if the specified unit is supported.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    boolean m = y.isSupported(ChronoUnit.YEARS);
    System.out.println(m);//from   www . j  a  v a2 s. c  om

}

From source file:Main.java

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

}