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.
isSupported
has the following syntax.
public boolean isSupported(TemporalField field)
The following example shows how to use isSupported
.
import java.time.MonthDay; import java.time.temporal.ChronoField; /* www . j av a 2 s . c om*/ 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.