what is the difference between equals method and ==

Answer Posted / devarathnam c,kotagudibanda(po

Hi...
"equals()" method always compares the content of an
object,but "==" operator compares the memory locations
(references).
eg: String s1="KOTAGUDIBANDA";
Where "s1" is a reference and "KOTAGUDIBANDA"is a content.

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which package is always imported by default?

555


What is the difference between post and put?

544


How many characters is 2 bytes?

538


What is difference between static variable and global variable?

554


what is singleton in java?

612






What the difference is between execute, execute Query, execute Update?

384


Can a main method be overloaded?

582


Describe the process as to how substring() methodology mechanisms in java.

569


What are abstract methods in java?

664


Are strings immutable in java?

532


What is loop in java?

541


Is 9 a prime number?

477


Explain treeset?

597


What are the 4 versions of java?

567


What are the parts of methodology?

555