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

How many ways can we create singleton class?

514


What is difference between variable declaration and definition?

523


Why is core java important?

578


State some advantages of java?

722


What are different access specifiers in java? Explain

639






Does sprintf add a null terminator?

572


What is quick sort in java?

569


Which class represents the socket that both the client and server use to communicate with each other?

582


What java is used for?

669


How would you use Bubble Sort to sort the number of elements?

590


Why deletion in linkedlist is fast than arraylist?

544


Compare java and python.

582


What is integers and example?

502


What are multiple inheritances? Is it supported by java?

475


What is difference between final and finally in java?

599