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  Marcus Mock 3 No. 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "instanceof  Marcus Mock 3 No. 6" Watch "instanceof  Marcus Mock 3 No. 6" New topic
Author

instanceof Marcus Mock 3 No. 6

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Which of the following statements are true?
1) The instanceof operator can be used to determine if a reference is an instance of a class, but not an interface.
2) The instanceof operator can be used to determine if a reference is an instance of a particular primitive wrapper class
3) The instanceof operator will only determine if a reference is an instance of a class immediately above in the hierarchy but no further up the inheritance chain
4) The instanceof operator can be used to determine if one reference is of the same class as another reference thus
the given answer is 2. I have no idea and please help.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Check the JLS definition.
Hope this helps....
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: instanceof Marcus Mock 3 No. 6
 
Similar Threads
A Question from Marcus exam 3 about instanceof
Test Question - Explanation?
Using instanceof operator
instanceof
question on instanceof operator..