Question: 2. Consider the following Java program. class Game ( private Board board; public Game () ( ' board new Board(); public void move (Player
2. Consider the following Java program. class Game ( private Board board; public Game () ( ' board new Board(); public void move (Player P, int d) ( board.move (p, d); class Board ( private Cell cell public Board () { 1 cell new Cell[64]; for (int i=0; i < 64; i++) cell[i] new Cell(); public void move (Player p, int d) { Token token - p.getToken(); Cell cell move (token, d); cell.placeToken (token); public cell move (Token t, int d) { T class Player { private Token token; public Token getToken () { 1 return token, class Token { ' class Cell public Cell() { 1 public void placeToken (Token t) { Draw an Object Sequence Diagram to show the object interactions that occur when the following statement is executed: game. move (player, 5); (5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
