Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote