+1 vote
in JAVA by

What’s the difference between == and .equals()?

1 Answer

0 votes
by

What’s the difference between == and .equals()?

1) “==” is an operator, whereas .equals() is a function.

2) “==” checks if the references share the same location, whereas .equals() checks if both object values are the same on evaluation.

Related questions

+1 vote
asked Oct 16, 2020 in JAVA by SakshiSharma
+3 votes
asked May 13, 2021 in JAVA by rajeshsharma
...