What is the difference between getClass and instanceOf?

Coming to the point, the key difference between them is that getClass() only returns true if the object is actually an instance of the specified class but an instanceof operator can return true even if the object is a subclass of a specified class or interface in Java.

Sizin İçin Seçtik  What skills do I need to be an iOS developer?

Leave a Reply

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