Enumeration

Last Modified On : 21-Aug-2004

// Enumeration 
public class Enum
{    enum Week {mon,tue,wed,thu,fri,sat,sun};
     public static void main(String args[])
     {
         Week w = Week.fri;

         switch( w)
         {
           case mon :
           case tue : System.out.println("Beginning of the week");  break;
           case wed :
           case thu : 
           case fri : System.out.println("Middle of the week"); break;
           default  : System.out.println("Weekend");
         }

         // you can even display the details values of emum
         for ( Week wk : Week.values())
             System.out.println(wk);
  
     }
}