Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java Looping Through Array Elements

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]);
   }
 }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #Java #Looping #Through #Array #Elements
ADD COMMENT
Topic
Name
8+3 =