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

i dont knw waht iam doing wrong here.. help

i dont knw wat m duing here.

Spaceship.java
public class Spaceship {
    public String mType;

    public String getType() {
      return mType;
    }

    public void setType(String type) {
      mType = type;
    }
public String shipType;
  public String shiptype;

  public class Spaceship{ public String shipType;

public String getShipType() { return shipType; }

public void setShipType() { this.shipType = shipType; 
}

1 Answer

Daniel Hartin
Daniel Hartin
5,247 Points

Hi Jonathan,

I assume you have simply pasted your code in twice, the top class looks good but the variable name you have used must be shipType not mType (I always use the m prefix for member variable too!) I can't really understand the rest of it as the formatting has gone a little askew but I think you're almost there, the challenges can be a little annoying sometimes when they are specific about variables names etc but I suppose it's all good practice for accuracy int eh real world.

I've posted some working code below:

public class Spaceship{

  public String shipType;

  public String getShipType(){
    return this.shipType;  
  }

  public void setShipType(String shipType){
    this.shipType = shipType;
  }

}

Hope this helps Daniel