Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

difference b/w == and equals()



Share on Google+Share on Google+

subhash chandra bose
difference b/w == and equals()
1 Answer(s)      6 years and 7 months ago
Posted in : Java Interview Questions

what is the difference between == operator and equals()

View Answers

December 8, 2010 at 2:18 PM

Hi Friend,

The == operator checks if the two objects were actually the same object. This operator looks at the actually memory address whereas the equals() method is used to compare the values of the object.



Related Tutorials/Questions & Answers: