![]() |
VOOZH | about |
The isSupported(TemporalField) method of Year class is used to check if the specified field is supported by Year class or not means using this method we can check if this Year object can be queried for the specified field.
The supported fields of ChronoField are:
All other ChronoField instances will return false.
Syntax:
public boolean isSupported(TemporalField field)
Parameters: Field which represents the field to check.
Return Value: Boolean value true if the field is supported on this Year, false if not.
Below programs illustrate the isSupported(TemporalField) method:
Program 1:
Output
Year :2019 YEAR_OF_ERA Field is supported by Year class: true
Program 2A:
Year :2022 MilliSecond Field is supported: false
Program 2B:
Output:
Is year supported? true Is day of week supported? true