DayOfWeek values()
returns an array containing the constants
of this enum type, in the order they are declared.
values
has the following syntax.
public static DayOfWeek[] values()
The following example shows how to use values
.
import java.time.DayOfWeek; public class Main { public static void main(String[] args) { for (DayOfWeek c : DayOfWeek.values()){ System.out.println(c); } } }
The code above generates the following result.