Java in the array traversal

That is, each element in the array are get out is to walk. Traversing the cornerstone of the array operation.

Array index is 0 to lenght-1, cycle condition occurs as

public  class ArrayDemo4 {
     public  static  void main (String [] args) {
         int [] = {ARR. 1,. 3,. 5,. 7,. 9 };
         // for traversing the array 
        for ( int I = 0; I <arr.length ; I ++ ) { 
            System.out.println (ARR [I]); 
        } 
    } 
}

 

Guess you like

Origin www.cnblogs.com/libinhong/p/10988778.html