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.
public boolean isSupported(TemporalField field)
Parameters:</strong This method accepts only one parameter field which represents the field to check.
Return Value: This method returns the boolean value true if the field is supported on this Year, false if not.
Below programs illustrate the isSupported(TemporalField) method:
Year :2019 YEAR_OF_ERA Field is supported by Year class: true
Year :2022 MiliSecond Field is supported: false
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.