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:
|
Is it helpful?
Yes
No
Most helpful rated by users: