Assume the following partial declarations have been made, with default (no param
ID: 3643372 • Letter: A
Question
Assume the following partial declarations have been made, with default (no parameter) constructors for the classes.public abstract class Player
public class ComputerPlayer extends Player;
public class SmartComputerPlayer extends ComputerPlayer;
Consider the following declarations.
I. ComputerPlayer playerA = new SmartComputerPlayer();
II. Player playerB = new SmartComputerPlayer();
III. Player playerC = new Player();
Which of these declarations will compile correctly?
A.) I only
B.) II only
C.) III only
D.) I and II
E.) II and III
Explanation / Answer
D) I and II
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.