Java Vector equals() MethodThe equals() method of Java Vector class used to compare the specified object with this Vector for equality. It returns true if and only if the specified object is also a list, both lists have the same size and all corresponding pairs of elements in the two lists are equal. Syntax:Following is the declaration of equals() method: Parameter:
Returns:The equals() method returns true if the specified object is equal to this Vector, otherwise returns false. Exceptions:NA Compatibility Version:Java 1.2 and above Example 1:Test it NowOutput: Is vector1 equals vector2 ? false Example 2:Test it NowOutput: Is vector1 equals vector2 ? true Vector list: [1, 2, 3, 1, 2, 3] Next TopicJava Vector |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India