Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1: Did HumanPlayer inherit all of players attributes and methods, including constructors? What are the access modifiers for the inherited methods and attributes? Question
Question 1: Did HumanPlayer inherit all of players attributes and methods, including constructors? What are the access modifiers for the inherited methods and attributes?
Question 2: HumanPlayer ahp = new HumanPlayer(); ahp.play(); which method is called?
Question 3: How does HumanPlayer call players constructor?
public class player private String si,; protected Object shape; player)( public Object getShape() return shape; // not good practise to allow other client classes // to change the player's character // a good practise is to protect this method as private // only itself can change the player character private void setShape(Obiect shapel / only 1 se can change the payer charaoters this.shape shape; // intialize a player with a character representing it public player(Object playerchar) super); this.shape playerchar public class HumanPlayer extends player HumanPlayer) supar HumanPlayer(Object shape)( //super) this.shape shape; Override public void play(TicTacToeBoard ttcb) super play (ttcb)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started