Here you can find the source of hasDuplicates(Vector v)
public static boolean hasDuplicates(Vector v)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static boolean hasDuplicates(Vector v) { int i = 0; int j = 0; boolean duplicates = false; for (i = 0; i < v.size() - 1; i++) { for (j = (i + 1); j < v.size(); j++) { if (v.elementAt(i).toString().equalsIgnoreCase(v.elementAt(j).toString())) { duplicates = true;// ww w .j av a 2 s .co m } } } return duplicates; } }