Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > Other Topics > Science, Math, and Philosophy
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2005, 04:09 PM
DireWolf DireWolf is offline
Senior Member
 
Join Date: Nov 2004
Posts: 137
Default java help

I just beginning programming/java so bear with me.

Im trying to create a list.

i imported List with:

import java.util.List;

In a method i try to create my list with:

List<Character> chars = new List<Character>();

(This is Java 1.5, so i have to include the type of List when creating it)

The error message i get is:

java.util.List is abstract; cannot be instantiated


Anyone have any ideas??
thanks


(x-post in CTH, but nobody looks there)
Reply With Quote
  #2  
Old 10-24-2005, 04:18 PM
DougShrapnel DougShrapnel is offline
Member
 
Join Date: Oct 2004
Posts: 55
Default Re: java help

I think you have to use a class that extends list. Try vector.

There is a java.awt list that you can directly instanciate.

But I could be wrong haven't programed in Java in awhile.
Reply With Quote
  #3  
Old 10-24-2005, 04:39 PM
Filip Filip is offline
Senior Member
 
Join Date: Sep 2003
Location: Malmö - Sweden
Posts: 103
Default Re: java help

List myList;
myList<Character> chars = new List<Character>();
Reply With Quote
Reply


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

Forum Jump


All times are GMT -4. The time now is 10:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.