Answers for "shortcut for for loop in java for charcater arrays"

0

shortcut for for loop in java for charcater arrays

class Main {
 public static void main(String[] args) {

   char[] vowels = {'a', 'e', 'i', 'o', 'u'};
  
   // iterating through an array using the for-each loop
   for (char item: vowels) {
     System.out.println(item);
   }
 }
}
Posted by: Guest on December-12-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language