Why type casting is required while using itrerator object in the while loop? [duplicate]
问题 This question already has answers here : What is a raw type and why shouldn't we use it? (15 answers) Closed 2 years ago . I am learning java right now. While writing code for traversing ArrayList using Iterator I have to use the class name before using the iterator's object with next() function. Can anybody help me with this? import java.util.*; public class arraylistwithuserdefinedclass { public static void main(String[] args) { ArrayList<UserId> details=new ArrayList<UserId>(); UserId a=