1 | for ( int i= 0 ; i < integerArray.length; i++) { |
2 | System.out.println( integerArray[i] ); |
3 | } |
to
1 | // read below as int i "in" integerArray |
2 | for ( int i : integerArray){ |
3 | System.out.println( i ); |
4 | } |
Better, huh? Same stuff works with object arrays too.
No comments:
Post a Comment