Grokking Java Basics
Vote

0% completed

​

instanceof Operator

The instanceof operator in Java is used to test whether an object is an instance of a specified class or interface. It returns a boolean value (true or false) based on the comparison. This operator is particularly helpful when you work with class hierarchies or need to verify an object's type before performing type-specific operations.

The instanceof Operator

| Operator | Description | Example |

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content