Is there any easy and quick way to merge 2 java vectors to 1?
For example if I have:
Vector<Object> Va = (Vector<Object>)Return_Vector_with_Objs(); Vector<Object> Vb = (Vector<Object>)Return_Vector_with_Objs(); Vector<Object> Vmerge_a_b = function_that_takes_a_b_merges(Va,Vb); Is there any function like function_that_takes_a_b_merges or easy way to merge these 2 vectors ?
I don't want to do it with loops and add() etc. I am asking if there is a quicker way.
EDIT: I also want the repeated objects to be ruled out.
Vector#addAll, aTreeSetif you want orderer unrepeated elements, anArrayListor even aLinkedList. What's merging for you? the elements of vector1 followed by the elements of vector2?.