Two Laptop Bag*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 19541
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instanceof and isInstance
 
Similar Threads
Instance of "Object" class
Instance Of
isInstance
instanceof
instanceof Operator