aspose 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 Java 8 in Action this week in the Java 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instanceof Marcus Mock 3 No. 6
 
Similar Threads
question on instanceof operator..
A Question from Marcus exam 3 about instanceof
Test Question - Explanation?
instanceof
Using instanceof operator