Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-22-2007, 01:36 AM   #1 (permalink)
 
Newb Techie

Join Date: Oct 2005

Posts: 40

Grumpy

Send a message via Yahoo to Grumpy
Default Java ArrayList Problem

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?
Grumpy is offline  
Old 03-22-2007, 01:45 AM   #2 (permalink)
 
Newb Techie

Join Date: Oct 2005

Posts: 40

Grumpy

Send a message via Yahoo to Grumpy
Default Re: Java ArrayList Problem

Nevermind.. had to import java.util.ArrayList instead of just java.util.*
Grumpy is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On