CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What's the difference between the == operator and the equals() method? What test does Object.equals() use, and why?
Category Java Interview Questions
Rating (2.8) By 6 users
Added on 10/13/2004
Views 1525
Rate it!
Answers:

The == operator would be used, in an object sense, to see if the two objects were actually the same object. This operator looks at the actually memory address to see if it
actually the same object. The equals() method is used to compare the values of the object respectively. This is used in a higher level to see if the object values are equal.
Of course the the equals() method would be overloaded in a meaningful way for whatever object that you were working with.



If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    Why do you create interfaces, and when MUST you use one?
    View Answer
    What is the difference between instanceof and isInstance?
    View Answer
    Are there any other 'marker' interfaces?
    View Answer
    How many methods do u implement if implement the Serializable Interface?
    View Answer
    What are the advantages of OOPL?
    View Answer
    What do mean by polymorphism, inheritance, encapsulation?
    View Answer
    What do you mean by static methods?
    View Answer
    What do you mean by virtual methods?
    View Answer
    Given two tables Student(SID, Name, Course) and Level(SID, level) write the SQL statement to get the name and SID of the student who are taking course = 3
    and at freshman level.
    View Answer
    What are the disadvantages of using threads?
    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL Java Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions
    Page URL: http://www.coolinterview.com/interview/379/default.asp?cachecommand=bypass


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

    1.48
    Cache = 1.515625 Seconds