I've just started learning
java, and I'm of course using the book Head First Java
This chapter's topic is ArrayLists but unfortunately I have run into some problems:
1. When I try to run the following code I get an error:
The error I get is:
ArrayList.java:3: type ArrayList does not take parameters
ArrayList<String> myList = new ArrayList<String>();
^
ArrayList.java:3: type ArrayList does not take parameters
ArrayList<String> myList = new ArrayList<String>();
^
2 errors
What am I doing wrong here? I've more or less copied the code out of the book.
2. I also get an error when trying to compile this file:
Error:
ArrayList2.java:6: cannot find symbol
symbol : method add(SimpleObject)
location: class ArrayList
myList.add(b);
^
Why doesn't t his work?
Can anyone give me a hint or two?