aspose file tools*
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Makes people Fool by == and equals()