for(int i=0; i < integerArray.length; i++) {
System.out.println( integerArray[i] );
}
to
// read below as int i "in" integerArray
for(int i : integerArray){
System.out.println( i );
}
Better, huh? Same stuff works with object arrays too.
for(int i=0; i < integerArray.length; i++) {
System.out.println( integerArray[i] );
}
// read below as int i "in" integerArray
for(int i : integerArray){
System.out.println( i );
}
A blog about programming and yes it is caught somewhere in time
No comments:
Post a Comment