MonthDay isSupported(TemporalField field) example
Description
MonthDay isSupported(TemporalField field)
checks if
the specified field is supported.
The supported fields are: MONTH_OF_YEAR
and YEAR
.
All other ChronoField instances will return false.
Syntax
isSupported
has the following syntax.
public boolean isSupported(TemporalField field)
Example
The following example shows how to use isSupported
.
import java.time.MonthDay;
import java.time.temporal.ChronoField;
/*from www .jav a 2 s .c o m*/
public class Main {
public static void main(String[] args) {
MonthDay m = MonthDay.now();
boolean n = m.isSupported(ChronoField.MONTH_OF_YEAR);
System.out.println(n);
}
}
The code above generates the following result.