What is the use of Instanceof operator in Java explain with help of any example also explain in your own words?

The instanceof operator in Java is used to check whether an object is an instance of a particular class or not . objectName instanceOf className; Here, if objectName is an instance of className , the operator returns true . Otherwise, it returns false .

Sizin İçin Seçtik  Java Package ne işe yarar?

Leave a Reply

Your email address will not be published. Required fields are marked *