Browsing tag: downcasting

instanceof operation in java

instanceof – Know Object Type in Java


In Java, instanceof operator is used to check the type of an object at run-time.   instanceof operator is important in case of down-casting object at run-time. instanceof operator return boolean value, if an object reference is of specified type then it return true otherwise false. Simple rule is “instanceof” would return true for all the