1/**
2 * A Java enum toString example.
3 * @author alvin alexander, alvinalexander.com
4 */
5public class JavaEnumToStringExample
6{
7
8 public static void main(String[] args)
9 {
10 // loop through the enum values, calling the
11 // enum toString method for each enum constant
12 for (Day d: Day.values())
13 {
14 System.out.println(d);
15 }
16 }
17}
18
19enum Day
20{
21 SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
22}
23