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

Why does it take so much time to access an applet having swing components the first time?

1392


What is difference between classpath and path variables in java?

549


How to compare two strings in java program?

669


What languages are pass by reference?

536


Can a class with private constructor be extended?

484






Can an interface be final?

539


Why singleton pattern is better than creating singleton class with static instance?

532


What are benefits of java?

552


take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).

1529


Where is java located?

493


Explain the access modifiers for a class, method and variables?

649


What is stored procedure. How do you create stored procedure ?

1490


Which keyword specify that a variable is effectively final ?

562


how does multithreading take place on a computer with a single cpu? : Java thread

688


What is the difference between this() and super() in java?

538