Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can anyone help with this error?? java ic class stackDriver { public static void main(String[] args) { StackInterface strStack = new ArrayStack (); Player player

can anyone help with this error?? java image text in transcribed
image text in transcribed
ic class stackDriver { public static void main(String[] args) { StackInterface strStack = new ArrayStack(); Player player = new.Player(kex D): player.setScore (29); strStack.push(player); - The constructor Player(String) is undefined 5 quick fixes available: player = new Player("Chci player.setScore (13); Add arguments to match 'Player(String, int String strStack.push(player); Romove argument to match 'Player + Change constructor Player Add parameter 'String: player = new.Player("Zane Change constructor Player(String, int. String: Remove parameters player.setScore (31); strStack.push(player); o Create constructor Player(String) player = new Player. Wall player.setScore (39); 18 3 import java.util.Random; 4 5 public class Player { private String playersName; private int score; 10 private String rank; 11 12 Il players methods 13 140 public Player() 15 16 { 17 this.playersName = ""; 19 20 this.score 0; 21 22 this.rank = "Level 1"; 23 24 } 25 25 public Player(String name) { 27 28 this.playersName = name; 29 30 } 31 32 //accessors public String getName() { return playersName; } 35 36 public int getScorel) {return score;} 37 38 public String getRank() { return rank; } 39 40 //mutators 41 42 public void setNome (String name) { this.playersName = name;} 43 public void setScore(int score) { this.score = score;) 46 public void setRank(String rank) { this.rank = rank; } 47 48 49 SD public void play() 51 33 ic class stackDriver { public static void main(String[] args) { StackInterface strStack = new ArrayStack(); Player player = new.Player(kex D): player.setScore (29); strStack.push(player); - The constructor Player(String) is undefined 5 quick fixes available: player = new Player("Chci player.setScore (13); Add arguments to match 'Player(String, int String strStack.push(player); Romove argument to match 'Player + Change constructor Player Add parameter 'String: player = new.Player("Zane Change constructor Player(String, int. String: Remove parameters player.setScore (31); strStack.push(player); o Create constructor Player(String) player = new Player. Wall player.setScore (39); 18 3 import java.util.Random; 4 5 public class Player { private String playersName; private int score; 10 private String rank; 11 12 Il players methods 13 140 public Player() 15 16 { 17 this.playersName = ""; 19 20 this.score 0; 21 22 this.rank = "Level 1"; 23 24 } 25 25 public Player(String name) { 27 28 this.playersName = name; 29 30 } 31 32 //accessors public String getName() { return playersName; } 35 36 public int getScorel) {return score;} 37 38 public String getRank() { return rank; } 39 40 //mutators 41 42 public void setNome (String name) { this.playersName = name;} 43 public void setScore(int score) { this.score = score;) 46 public void setRank(String rank) { this.rank = rank; } 47 48 49 SD public void play() 51 33

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago