isSupported() method of the MonthDay class used to Check if the specified field is supported by MonthDay class or not means using this method we can check if this MonthDay 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: This method accepts one parameter field which is the field to check.
Return value: This method returns returns boolean value true if the field is supported on this MonthDay, false if not.
Below programs illustrate the isSupported() method:
MONTH_OF_YEAR Field is supported: true
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.