Can I use Instanceof for interface in Java?

instanceof can be used to test if an object is a direct or descended instance of a given class. instanceof can also be used with interfaces even though interfaces can’t be instantiated like classes.

Sizin İçin Seçtik  What is the purpose of following syntax public final class getClass ()?

Leave a Reply

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