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... }
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.
How do you benchMark? Is it Just a way of checking how much time each loop takes.Do you do it using time functions.? Or is there someother method to do this? Thanks.
Post by:autobot
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, that will fit in a stocking