This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes instanceof and isInstance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "instanceof and isInstance" Watch "instanceof and isInstance" New topic
Author

instanceof and isInstance

Krishna Latha Grandhi
Ranch Hand

Joined: Nov 08, 2005
Posts: 110
What is the difference between instanceof and isInstance
whether isInstance() belongs to 1.4 or not?
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
What is the difference between instanceof and isInstance


instanceof is used to check to see if an object can be cast into a specified type without throwing a cast class exception.

isInstance() Determines if the specified Object is assignment-compatible with the object represented by this Class.


whether isInstance() belongs to 1.4 or not?


Hope 1.4(not sure)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

isInstance() has been part of the Class class since JDK 1.1


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: instanceof and isInstance