Here you can find the source of removeDuplicates(Vector s)
public static Vector removeDuplicates(Vector s)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Vector removeDuplicates(Vector s) { int i = 0; int j = 0; boolean duplicates = false; Vector v = new Vector(); for (i = 0; i < s.size(); i++) { duplicates = false;/* w ww. jav a2 s .com*/ for (j = (i + 1); j < s.size(); j++) { if (s.elementAt(i).toString().equalsIgnoreCase(s.elementAt(j).toString())) { duplicates = true; } } if (duplicates == false) { v.addElement(s.elementAt(i).toString().trim()); } } return v; } public static Vector removeDuplicates(Vector a, Vector b) { int i = 0; int j = 0; boolean present = true; Vector v = new Vector(); for (i = 0; i < a.size(); i++) { present = false; for (j = 0; j < b.size(); j++) { if (a.elementAt(i).toString().equalsIgnoreCase(b.elementAt(j).toString())) { present = true; } } if (!(present)) { v.addElement(a.elementAt(i)); } } return v; } }