Your very own droid


#1

https://www.codecademy.com/courses/learn-java/projects/droid

trying to get this error to go away:
Droid.java:35: error: missing return statement
}
^
1 error

on my last line before the main it wont stop throwing the error no matter what i do. please advise


public class Droid {
	int batteryLevel; 
  Droid() {
    batteryLevel = 100;
  }
	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 int checkBatteryLevel() {
					System.out.println("Battery level is: " + 				batteryLevel + " percent.");
      		return batteryLevel;
		}
public int hover (int feet){
  	if (feet > 2){
    System.out.println("Error! I cannot hover above 2 feet.");
  } 
  	else{
      System.out.println("Hovering...");
      batteryLevel = batteryLevel - 20;
  System.out.println("Battery level is: " + batteryLevel + " percent.");   
}
}
  public static void main(String[] args){
  Droid myDroid = new Droid();
  myDroid.activate();
  myDroid.chargeBattery(5);
  myDroid.hover(5);
	}
}

#2

java is strongly typed, which means here:

public int hover (int feet)

the int keyword means that you promise java that this function will return an integer value. Which is not happening. So there are two options: return an integer value or changing the return type