Learn Java Programming - Instanceof Operator Tutorial

Published: 24 January 2016
on channel: Daniel Ross
1,437
14

The first thing that we need to understand is the definition of a supertype. A supertype is a class or interface that is higher up the inheritance hierarchy. The instanceof operator compares an object(instance) to the Name of a supertype and returns a boolean result. The instanceof operator will also return true if the instance is of the same class name.
(reference variable) instanceof (Name of supertype)
String s = "Hello World";
s instanceof Object; // true


On this page of the site you can watch the video online Learn Java Programming - Instanceof Operator Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 24 January 2016, share the link with friends and acquaintances, this video has already been watched 1,437 times on youtube and it was liked by 14 viewers. Enjoy your viewing!