It is showed that I have one error in the line 21. Therefore, I need help

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

```

class Droid{
int batteryLevel = 100;
public Droid() {
}
public void activate(){
System.out.println(“Activated. How can I help you?”);
batteryLevel = batteryLevel - 5;
System.out.println(“Battery level is: " + batteryLevel + " percent.”);
}
public void chargeBattery(){
int hours;
System.out.println(“Droid charging…”);
batteryLevel = batteryLevel + hours;
if (batteryLevel >= 100){
batteryLevel = 100;
System.out.println(“Battery level is: " + batteryLevel + " percent.”);
} else {
System.out.println(“Battery level is: " + batteryLevel + " percent.”);
}
}
public checkBatteryLevel(int batteryLevel){
System.out.println(“Battery level is: " + batteryLevel + " percent.”);
return batteryLevel;
}
}

<do not remove the three backticks above>

You have to specify return type (the data type of the value returned by the method) for the checkBatteryLevel method.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.