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

Finally, add the setter method!

need help

Spaceship.java
public class Spaceship{ public String shipType;

public String getShipType() { return shipType; }

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

}

1 Answer

Gabriel Pierce-Lackey
MOD
Gabriel Pierce-Lackey
Treehouse Moderator 10,972 Points

You are very close. We are going to pass in a String type and set this.shipType to that type. I don't know Java too well to be honest, so excuse me if that sounds incorrect but this code did pass the quiz.

public class Spaceship{ public String shipType;

public String getShipType() { return shipType; }

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

}