what is the difference between equals method and ==

Answer Posted / anoop

Normally == using to compare value type. If 2 object is
refering same memmory, it will return true otherwise false

Comparing object , you have to use equals, bz it will
compare all the values in it.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we make constructors static?

730


What is ++ a in java?

574


What is the main purpose of java?

522


What are the restrictions imposed by a Security Manager on Applets?.

2073


What is the formula to calculate percentage?

540






What is pass by value?

517


Can we override data members in java?

632


What do you mean by of string::valueof expression in java 8?

549


How does a cookie work in Servlets?

357


Why java strings are immutable in nature?

596


What is jit compiler ?

580


What is void in java?

597


Is array size fixed in java?

546


Which sorting is used in arrays sort in java?

590


Explain the difference between comparator and comparable in java?

490