Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Looping Through Array Elements Java

class Main {
 public static void main(String[] args) {
  
   // create an array
   int[] age = {12, 4, 5};

   // loop through the array
   // using for loop
   System.out.println("Using for Loop:");
   for(int i = 0; i < age.length; i++) {
     System.out.println(age[i]);
   }
 }
}
 
PREVIOUS NEXT
Tagged: #Looping #Through #Array #Elements #Java
ADD COMMENT
Topic
Name
1+6 =