Why does the new ArrayList() in my code errors. I don't get It. Can someone help me, its really urgent. Thanks
public static ArrayList<String> sub = new ArrayList();
public static ArrayList<String> subCourse = new ArrayList();
class Main
{
public static ArrayList<String> sub = new ArrayList();
public static ArrayList<String> subCourse = new ArrayList();
public static void main (String[] args) {
Main.sub.add("the");
System.out.println(Main.sub.get(0));
}
}
It seems that it works good.
Comments
Leave a comment