Java ArrayList Problem

Status
Not open for further replies.

Grumpy

Baseband Member
Messages
48
I'm trying to write a program for a college class and I'm supposed to use four ArrayLists to store random numbers, but I keep getting an error when I first try to create the ArrayLists. This is what I typed:

ArrayList<Integer> list1, list2, list3, list4;
list1 = new ArrayList<Integer>();
list2 = new ArrayList<Integer>();
list3 = new ArrayList<Integer>();
list4 = new ArrayList<Integer>();

And I get the error: "type ArrayList does not take parameters".

How do I fix this? Is there any way to shorten this?
 
Status
Not open for further replies.
Back
Top Bottom