DayOfWeek SUNDAY example
Description
DayOfWeek SUNDAY
is the constant for the day-of-week of Sunday.
This has the numeric value of 7.
Syntax
SUNDAY
has the following syntax.
public static final DayOfWeek SUNDAY
Example
The following example shows how to use SUNDAY
.
import java.time.DayOfWeek;
/*from w w w .j a v a 2s. c o m*/
public class Main {
public static void main(String[] args) {
DayOfWeek dayOfWeek = DayOfWeek.SUNDAY;
System.out.println(dayOfWeek.name());
System.out.println(dayOfWeek.getValue());
System.out.println(dayOfWeek.ordinal());
}
}
The code above generates the following result.