java:Collection
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   muneer_smd
Posted On:   Sunday, May 21, 2006 11:30 PM

How to convert Arraylist to Vector? can anybody tell me?

Re: java:Collection

Posted By:   Anonymous  
Posted On:   Saturday, May 27, 2006 02:57 AM

You will have to get each object from ArrayList and then add to vector one by one.

Object ArrayList.get(index)
Vector.add(index,Object)

Re: java:Collection

Posted By:   WarnerJan_Veldhuis  
Posted On:   Monday, May 22, 2006 07:12 AM


Vector myVector = new Vector( myList );


The constructor of Vector takes a Collection as an argument.



If it's an existing Vector, you can use addAll(Collection) to copy the data.

About | Sitemap | Contact