What is instance of operater & Why and When it is used.

Showing Answers 1 - 1 of 1 Answers

amoham19

  • Jan 17th, 2008
 

instanceof is used to test an object's type
Example:
Pizza myPizza = new Pizza();
boolean test = myPizza instanceof Pizza;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions