Java Instanceof Operator

In this tutorial you will learn about the Java Instanceof Operator and its application with practical example.

Java instanceof Operator

In Java, the instanceof operator is used to determine whether an object is an instance of a class, a subclass, or an interface or not.

Table Of Contents

Example:-

Output:-

java_instanceof_operator_example

When you run the above java program, it will output true. It’s because str is the instance of the String class.

In this tutorial we have learn about the Java Instanceof Operator and its application with practical example. I hope you will like this tutorial.