An instanceof in Java is a comparison operator which, given an object instance, checks whether that instance is of a specified type (class/sub-class/interface) or not . Just like other comparison operators, it returns true or false.
An instanceof in Java is a comparison operator which, given an object instance, checks whether that instance is of a specified type (class/sub-class/interface) or not . Just like other comparison operators, it returns true or false.