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

CHRISTOPHER Riley
PRO
CHRISTOPHER Riley
Pro Student 1,161 Points

Why am I getting a naming error with: public String getshipType(){ return shipType;

I get the naming convention error for getshipType().

get + shipType... this is the convention, correct?

Spaceship.java
public class Spaceship {
  public String shipType;

  public String getshipType(){
    return shipType;
  };
};

1 Answer

Two things I would try. The name getshipType() does not follow the camelcase naming convention. It should be getShipType() the second thing I would do is return this.shipType;