This is the difference I am talkin about Can you please explain why and wha is the difference between the two for loops.
Please go back an re-read my response. Basically, the variable "i" in the enhanced for loop is *not* the index, but the value.
Are not the same logic...
Henry [ May 12, 2007: Message edited by: Henry Wong ]
Joined: May 06, 2007
Hi Henry Thanks for the explanation I got your point My question is when the enhanced for loop is used on line 1 and after that arr[i] that means value of i will be 1,2,3,4 so when it reaches 4 it should give ArrayIndexOutOfBoundException which it doesn't where as if you remove arr[i]=0; It does give that Can you clarify it further