Joey Sanchez wrote:Where does the error come from? import java.util.List; import java.util.ArrayList; import java.util.Iterator; class Father { public void iAm(){System.out.println("Father");} } class Son extends Father { public void iAm(){System.out.println("Son");} } public class Poly extends Son { public void iAm(){System.out.println("Poly");} public static void main(String[] args){ Father[] a = {new Father(), new Son(), new Poly()}; for(Father f:a) f.iAm(); ArrayList<Father> myL = new ArrayList<Father>(); myL.add(new Father()); myL.add(new Son()); myL.add(new Poly()); [color=red]Iterator i = new myL.iterator();[/color] //Poly.java:24: package myL does not exist // Iterator i = new myL.iterator(); // ^ //1 error while(i.hasNext()) i.next(); } }