Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instanceof and isInstance

 
Krishna Latha Grandhi
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between instanceof and isInstance
whether isInstance() belongs to 1.4 or not?
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isInstance() has been part of the Class class since JDK 1.1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic