should I use Vector() ?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   silvia_antunes
Posted On:   Monday, September 16, 2002 03:13 PM

I need to keep a list of clients with name and number.

I donĀ“t know how many clients will connect, should I use Vector().

How do I add this to a Vector()?



public class packageinit {


public int Initnum;

public String Name;

}

Re: should I use Vector() ?

Posted By:   Blake_Minghelli  
Posted On:   Monday, September 16, 2002 04:58 PM

You might also want to consider using an ArrayList. An ArrayList is now the preferred mechanism over Vector. Since you already have your data encapsulated into one object (packageinit), storing it in an ArrayList is easy:



ArrayList clientList = new ArrayList();
clientList.add(myPackageInitObject);


Hope that helps

Re: should I use Vector() ?

Posted By:   eimi_nos  
Posted On:   Monday, September 16, 2002 03:24 PM

You can use the HashMap. The primitive type int should be wrapped in the Integer class.
About | Sitemap | Contact