What is difference between == operation and equals() method? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is difference between == operation and equals() method?

I am asking this question in Java?

12th Mar 2017, 3:51 AM
Vishal Prajapati
2 Answers
+ 5
== compares the reference of the objects. equals() compares the actual content. equals() must be used for string comparisons.
12th Mar 2017, 4:08 AM
Dinesh
Dinesh - avatar
0
@Dinesh thanks
12th Mar 2017, 4:09 AM
Vishal Prajapati