Java Java Objects Harnessing the Power of Objects Computed Properties

Bummer: java.lang.IllegalArgumentException: ParseException: com.github.javaparser.ParseException: Encountered " "(" "( "

I need help

GoKart.java
class GoKart {
  public static final int MAX_BARS = 8;
  private String color;
  private int barCount;

  public GoKart(String color) {
    this.color = color;
  }

  public String getColor() {
    return color;
  }

  public void charge() {
    barCount = MAX_BARS;
  }

  public boolean isBatteryEmpty() {
   if (barCount == 0) {
      return true;
      }else{
      return  false;
      }

   public boolean isFullyCharged() {
    if (barCount ==  MAX_BARS) {
        return true;
        } else{
        return false;
       }
     }
   }  
}

1 Answer

I'm assuming you passed task 1 since you have code for task 2. Check your brackets. It looks like you created the method for task 2 inside the method for task 1. isBatteryEmpty() is missing a closing bracket and isFullyCharged() has one too many.