Here you can find the source of union(Vector a, Vector b)
public static Vector union(Vector a, Vector b)
//package com.java2s; import java.util.*; public class Main { public static Vector union(Vector a, Vector b) { Vector r = new Vector(); for (int i = 0; i < a.size(); i++) r.add(a.elementAt(i));// ww w . j av a 2 s . co m for (int i = 0; i < b.size(); i++) r.add(b.elementAt(i)); return r; } }