Differentiate between equals() and ==
Answers
Answered by
2
Answer:
equals() is a method of Object class. == should be used during reference comparison. == checks if both references points to same location or not. equals() method should be used for content comparison.
Answered by
0
The equals( ) and = = operator perform two different operations.
The equals( ) method compares the characters inside a String object whereas the = = operator compares two object references to see whether they refer to the same instance or not.
Similar questions