Missing Return Statement Error
I have problem with below method - I understand it means that Sting is not being retuned - but I don't understand why cause I clearly stated in code that string should be returned. Please help:
* If the argument is between 1 and 3 inclusive,
* sets the value of its playingMode instance variable to the value of the int argument,
* otherwise returns the string: "Playing mode unchanged".
public String selectProgram(int aValue)
if (aValue >= 1 && aValue <= 3)
if (this.getPlayingMode() == 1)
return "Repeat off";
if (this.getPlayingMode() == 2)
return "Repeat track";
if (this.getPlayingMode() == 3)
return "Repeat all";
return "Playing mode unchanged";
} ---- ERROR IS HERE -- It highlights this bracket.