LocalDate range(TemporalField field) example
Description
LocalDate range(TemporalField field)
gets the range of valid
values for the specified field.
Syntax
range
has the following syntax.
public ValueRange range(TemporalField field)
Example
The following example shows how to use range
.
import java.time.LocalDate;
import java.time.temporal.ChronoField;
/*from w w w.ja v a 2s . c o m*/
public class Main {
public static void main(String[] args) {
LocalDate a = LocalDate.of(2014, 6, 30);
System.out.println(a.range(ChronoField.DAY_OF_YEAR));
}
}
The code above generates the following result.