Computer Science, asked by sahildas9021, 7 months ago

Differentiate between equals() and ==​

Answers

Answered by riya15955
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 Oreki
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