I'm not sure what is wrong with rows (6) and (12). I moved the code out of the main method which I enjoy.
import java.util.ArrayList; public class P133_ArrayList { public static void main(String Args[]){ P133_ArrayList ar = new P133_ArrayList(); ar.run(); //expected class or package } class run { ArrayList<Egg> myList = new ArrayList<Egg>(); Egg egg1 = new Egg(); myList.add(Egg1); //cannot resolve symbol Egg1 Egg egg2 = new Egg(); myList.add(Egg2); Egg egg3 = new Egg(); myList.add(Egg3); int theSize = myLIst.size(); boolean isIn = myList.contains(egg1); int idx = myLIst.indexOf(egg2); boolean empty= mylist.isEmpty(); myList.remove(egg1); } class Egg{ String speak = "Cluck Cluck"; } }