Enahanced For Loop

Last Modified On : 21-Aug-2004


// Enhanced For Loop

public class ForLoop
{    enum Week {mon,tue,wed};
     public static void main(String args[])
     {
        int  a[] = {10,20,30,40,50};

         for( int i : a )
            System.out.println(i);   
      

         for (  Week w : Week.values())
          System.out.println(w);

   
     }
}