Question: Java Consider the following inheritance hierarchy that is used in a video game which of the following declarations and initializations are legal and will not
Java Consider the following inheritance hierarchy that is used in a video game which of the following declarations and initializations are legal and will not cause a compiler error? which of the following declarations and initializations are illegal and will cause a compiler error? Write the statement and label it as legal or illegal. a) Character c = new Flying Dragon (); b) Flying Dragon f = new character (); c) Dragon d = new Villain (); d) Villain v = new skeleton (); e) Dragon d = new shopkeeper ()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
