Month isSupported(TemporalField field) example
Description
Month isSupported(TemporalField field)
checks if the specified
field is supported.
Syntax
isSupported
has the following syntax.
public boolean isSupported(TemporalField field)
Example
The following example shows how to use isSupported
.
import java.time.LocalDate;
import java.time.Month;
import java.time.temporal.ChronoField;
//www . j av a 2s . c o m
public class Main {
public static void main(String[] args) {
Month m = Month.from(LocalDate.now());
System.out.println(m.isSupported(ChronoField.MONTH_OF_YEAR));
}
}
The code above generates the following result.