Panagiotis Kalogeropoulos wrote:I thought your question was about why to use iterators since we have the for loop (scratching my head......). Maybe the expression "pros and cons" that I used was not the best, but in that link you can see why and when you should use the for loop or an iterator. I don't know if that still answers your question (scratching my head again....).
Manoj Kumar Jain wrote:This code will not compile, not because the array is uninitialized. Array elements are initialized with their default value that is 0 for integers.
This will fail because there is a local variable size that is not initialized before using and that is line no. 5
Matthew Brown wrote:What makes you think the method doesn't exist? It's there in the documentation.