• Post Reply Bookmark Topic Watch Topic
  • New Topic

instanceof and isInstance  RSS feed

 
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?
 
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)
 
Sheriff
Posts: 21378
91
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
 
What are your superhero powers? Go ahead and try them on this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!