i have a problem . I'm trying to add and them retrieve objects of the same class to ArrayList , but when i try to retrieve them i get incompatible types erroe
import java.util.*;
public class Test{
Test(){
main();
}
List test = new ArrayList();
public void main(){
test.add(new Square(10));
Iterator i = test.iterator();
while(i.hasNext()){
Square temp = i.next();
}
}
}