LocalDateTime isSupported(TemporalField field)
checks if the
specified field is supported.
This checks if this date-time can be queried for the specified field.
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.LocalDateTime; import java.time.temporal.ChronoField; /*from w ww . j av a2s. com*/ public class Main { public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.isSupported(ChronoField.DAY_OF_WEEK)); } }
The code above generates the following result.