Java OOPs Interview Questions and Answers
Question: What is the 'instanceof' operator used for?Answer: The 'instanceof' operator in Java is used to test if an object is an instance of a particular class or interface. It returns true if the object is an instance; otherwise, it returns false.Example:
|
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Is it helpful? Yes No
Most helpful rated by users: