0452: Scanner tScanner = new Scanner(System.in); 0453: String tInputString = tScanner.next(); 0454: Day tInputDay = Day.valueOf(tInputString); 0455: switch (tInputDay) 0456: { 0457: case Sunday: System.out.println("wash car"); break; 0458: case Saturday: System.out.println("do nothing"); break; 0459: default: System.out.println("go to work"); break; 0460: } 0461: for (Day tDay : Day.values()) 0462: { 0463: System.out.println(tDay + " " + tDay.ordinal()); 0464: }
0500: Sunday 0501: wash car 0502: Sunday 0 0503: Monday 1 0504: Tuesday 2 0505: Wednesday 3 0506: Thursday 4 0507: Friday 5 0508: Saturday 6