The type ArrayList is not generic; it cannot be parameterized with arguments <String>
The type ArrayList is not generic; it cannot be parameterized with arguments <String>
I get the above errors when trying to inspect the following code in a java scrapbook:
[CODE]ArrayList<String> list = new ArrayList<String>();
Book b1 = new Book(“Great Expectations”);
Book b2 = new Book(“War and Peace”);
list.add(b1);
list.add(b2);
Person p1 = new Person();
p1.setName(“Fred”);
b1.setPerson(p1);
list
If I remove the <String> parameter to the ArrayList, then the code works ok.
The example from Mark Dexter’s “Eclipse and Java for Total Beginners” lesson09
[url]http://downloads.sourceforge.net/eclipsetutorial/totalbeginnerlesson09.zip
does not produce an error with the <String> parameter.
Any ideas why I have this error occurring please?
I’m running Eclipse Europa 3.3.2 on Fedora 8. I have also tried a different JVM, but still get the same error.