Originally posted by Aaron Webb:
Is there any difference in this code? If there is an SomeObject array called array...
SomeObject object = null;
for (int i = 0; i < array.length; i++) {
object = array[i];
...some processing...
}
or........
for (int i = 0; i < array.length; i++) {
SomeObject object = array[i];
...some processing...
}
I think no. 2 is wrong, you have to declare before the loop.