Android Build an Interactive Story App The Model-View-Presenter Pattern Creating a Data Model

Yahoo Mayers
Yahoo Mayers
659 Points

Not able to go past Quiz

Hi, This is my code, but it just keeps coming up as a syntax error. Could you please let me know what I'm doing wrong? Thanks.

public class Spaceship { public String shipType;

public String getShipType(){ return shipType;

}

public String setShipType(String s){
shipType = s;

}

}

Spaceship.java
public class Spaceship {
  public String shipType;  


  public String getShipType(){
    return shipType;

  }

    public String setShipType(String s){
    shipType = s;

  }



}

1 Answer

Seth Kroger
Seth Kroger
56,370 Points

Since you aren't returning anything from the setter, the return type needs to be void.