| Author |
Appending Vectors
|
Stephen Murphy
Greenhorn
Joined: Feb 26, 2004
Posts: 24
|
|
Is there a way to append one vector to the end of another? I was hoping there was a method already in java to do this. Otherwise I'll have to write one myself. Thanks, Stephen
|
 |
Garrett Rowe
Ranch Hand
Joined: Jan 17, 2006
Posts: 1295
|
|
|
Have you examined the addAll() method?
|
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
|
 |
Stephen Murphy
Greenhorn
Joined: Feb 26, 2004
Posts: 24
|
|
That was so amazingly obvious. Don't know how I missed a method that adds a collection. Thanks.
|
 |
sven studde
Ranch Hand
Joined: Sep 26, 2006
Posts: 148
|
|
>Is there a way to append one vector to the end of another? Why are you using a Vector? You most likely should be using an ArrayList, which is just like an array, but it can grow in size. Vector = oldschool, ArrayList = newschool. [ November 05, 2006: Message edited by: sven studde ]
|
 |
Sudhakar Reddy Kurakula
Ranch Hand
Joined: Aug 19, 2006
Posts: 42
|
|
Hi This is the code. Vector v1=new Vector(); //add elements. Vector v2=new Vector(); v1.add(v2); //now this appends at the end of the last element. Cheers Sudhakar Reddy M.C.A(2006) Satyam. 9989223696
|
 |
 |
|
|
subject: Appending Vectors
|
|
|