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

Is treeset sorted in java?

584


How can we create an immutable class in java?

583


What is bytecode in java ?

609


What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?

613


How do you remove duplicates from an array in java?

532






State one difference between a template class and class template.

625


What does 0 mean in boolean?

544


What is the difference between pass by reference and pass by pointer?

499


What is string builder in java?

556


Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.

7423


What is fail fast in java?

576


What is the transient keyword?

633


What are methods and how are they defined?

603


what is enumset?

584


Which collection is sorted in java?

552