File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes instanceof Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "instanceof" Watch "instanceof" New topic
Author

instanceof

ankana mukherjee
Greenhorn

Joined: Aug 22, 2008
Posts: 6
this from page no=526(k&B)

in the overriden equals method how can o instanceof Moof be true?
is it because two is instanceof Moof?
[ September 10, 2008: Message edited by: ankana mukherjee ]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Originally posted by ankana mukherjee:
this from page no=526(k&B)

in the overriden equals method how can o instanceof Moof be true?
is it because two is instanceof Moof?



Right, here temporary object 'o' , holds the reference of object Moof 'two' , thats mean 'two' is instance of "Moof' . Dont get confused with Generic Object instance to that of Moof object , here 'o' is just a reference , which can hold any Valid Java object !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instanceof