Java Chapter 4a4 cards

Tagged as: economics, software, computer science, nursing

 copy deck Copy deck


2

Is this valid: class Cat {} class Dog {} … Dog d = new Dog(); if(d instanceof Cat) {};

No. Compiler error. A Dog could never be an instance of Cat. Different hierarchy.