Vector.equals(Object o) has the following syntax.
public boolean equals(Object o)
In the following code shows how to use Vector.equals(Object o) method.
//ww w . j av a 2s . c o m import java.util.Vector; public class Main { public static void main(String[] args) { Vector<Integer> firstvec = new Vector<Integer> (4); Vector<Integer> secondvec = new Vector<Integer> (4); // additing in firstvec firstvec.add(4); firstvec.add(3); firstvec.add(2); // additing in secondvec secondvec.add(4); secondvec.add(3); secondvec.add(2); // let us print all the elements available in vector System.out.println("Testing equality of firstvec and secondvec :"+ firstvec.equals(secondvec)); } }
The code above generates the following result.