LocalTime isSupported(TemporalField field)
checks if the specified field is supported.
The supported fields are:
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.LocalTime; import java.time.temporal.ChronoField; // ww w . j a v a 2 s. com public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(); System.out.println(l.isSupported(ChronoField.MICRO_OF_SECOND)); } }
The code above generates the following result.