Abimaran Kugathasan wrote:The iterator method returns generically, but, you assigned it to a non-generic collection. So, you break the generics there, so, you need a cast!
The typed collection that the topic starter is using returns an typed Iterator. However he is then assigning it to a non-typed Iterator so the type information is lost. And because of that the cast is needed.