enhanced for loop java

Java
class AssignmentOperator {
   public static void main(String[] args) {
      
      char[] vowels = {'a', 'e', 'i', 'o', 'u'};
      // foreach loop
      for (char item: vowels) {
         System.out.println(item);
      }
   }
}class ForLoop {
   public static void main(String[] args) {
      
      char[] vowels = {'a', 'e', 'i', 'o', 'u'};

      for (int i = 0; i < vowels.length; ++ i) {
         System.out.println(vowels[i]);
      }
   }
}
Source

Also in Java: