I am making a simple test code to add an element to an Arraylist in JAVA:
import java.util.ArrayList;
class MyArrayList
{
public static void main(String[] args)
{
ArrayList list = new ArrayList();
list.add("Hello");
System.out.println(list);
}
}
But it is returning this error:
MyArrayList.java:8: error: cannot find symbol
ArrayList list = new Arraylist();
^
symbol: class Arraylist
location: class MyArrayList
Note: MyArrayList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.