0

I need help to fix this issue in one of my methods. I need to make a die where the value is returned as a String instead of an integer value. I am having difficulties with the roll method because I don't know if there is something missing. please let me know

private static String[] COLOR = {"BLUE", "RED", "GREEN", "YELLOW", "ORANGE", "PINK"};
 
 public ColoredDie() {
     this.setColor(color);
     this.randomizer = new Random();
 }
 //Methods
 public String getColor() {
     return this.color;
 }//Ending bracket of method getColor
 
 private void setColor(String newColor) {
     this.color = newColor;
 }//Ending bracket of method setColor
 
 public String roll() {
    this.randomizer = new Random();
    this.setColor(randomizer.next(COLOR.length) + 1);
    this.getColor();
 }//Ending bracket of method roll

I tried to make the the wanted value an int, but they want it as a String.

Progman
  • 16,827
  • 6
  • 33
  • 48

0 Answers0