O. Ziggy wrote:Thanks Henry. I thought that since the List provides the Iterator it will returned a typed iterator.
The iterator() method returns an object. It is you who declared the iterator reference and assigned it. There is no way to create a class, with a method, that returns an object, that can control how it will be assigned. If you want to create an iterator reference, that doesn't use generics, the compiler can't stop you. It just does what you want.
Henry