This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java Makes people Fool by == and equals() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Java Makes people Fool by == and equals()" Watch "Java Makes people Fool by == and equals()" New topic
Author

Java Makes people Fool by == and equals()

Hussain
Ranch Hand

Joined: Nov 22, 2001
Posts: 110
Salam(Hi) all,
hope every budy fine and doing well in java .Do any budy think tht java makes people fool by == and equals( ) as they do same work in object class and the Scjp2 exam have need to have a test on tht ?

------------------
Muhammad Hussain

Muhammad Hussain<br />Sun Certified Java Programer (SCJP2)<br />Sun Certified Web Component Devloper SCWCD
Fei Ng
Ranch Hand

Joined: Aug 26, 2000
Posts: 1242
Originally posted by Muhammad Hussain:
Salam(Hi) all,
hope every budy fine and doing well in java .Do any budy think tht java makes people fool by == and equals( ) as they do same work in object class and the Scjp2 exam have need to have a test on tht ?


What do you mean by same work?
If you mean the Object class's equals method with ==. Yea, it is.
But some Object overridden it, like String object. They actually compare the actually value of the Object not the reference.
 
jQuery in Action, 2nd edition
 
subject: Java Makes people Fool by == and equals()
 
Similar Threads
I WANT FALL IN LOVE
Trying out smilies
Posting to bump up my count...
Does a one-legged duck swim in a circle?
celebrations in pakistan after wtc hit