Here's the full question;
<em>Assume the following partial declarations have been made, with default (no parameter) constructors for the classes.</em>
<em />
<em>public abstract class Player</em>
<em>public class ComputerPlayer extends Player;</em>
<em>public class SmartComputerPlayer extends ComputerPlayer;</em>
<em />
<em>Consider the following declarations.</em>
<em />
<em>I. ComputerPlayer playerA = new SmartComputerPlayer();</em>
<em>II. Player playerB = new SmartComputerPlayer();</em>
<em>III. Player playerC = new Player();</em>
<em />
<em>Which of these declarations will compile correctly?</em>
A.) I only
B.) II only
C.) III only
D.) I and II
E.) II and III
<u>Answer:</u>
<u>C)</u>
Explanation:
One of the rules of Java programming is that it must have a class which is a blueprint that informs about the behavior that the object of that class support.
If we go by the strict rules of Java programming only the class declaration;
Player playerC = new Player();
would compile correctly.
All other options would result in compiler error.