Java Collection equals() MethodThe equals() method of Java Collection Interface compares the specified object with this collection for equality. SyntaxParametersThe parameter 'o' represents the object to be compared for equality with this collection. OverridesThis method overrides equals in class Object ReturnThe equals method returns Boolean value 'true' if the specified object is equal to this collection else it returns false. Example 1Test it NowOutput: true Example 2Test it NowOutput: Equals methods will return : false Next TopicJava Collection |
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