OK. Trying to get a grip on collections and although iterating through using a FOR statement makes sense, using the iterator method confuses me.
How do I reference tempDog.getName() using an iterator in the below snippet;
It's the first time I see an Iterator used with a for loop, but I still have lots to learn I usually prefer using a while loop instead.
Moreover, you are iterating through a list of Dog instances, so you should take advantage of Java's Generics here. Instead of declaring an Iterator of ?, you should use an Iterator of Dog. No need to cast then.
Anyway, using an enhanced for loop would do the same, but would be even more concise :