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

challenge Task 4of 4 Finally,add the setter

public class Spaceship{ public String shipType;

public String getShipType(){ return shipType; } public void setShipId(int ShipTypeId){ this.shiptypeId=ShiptypeId; } }

Spaceship.java
public class Spaceship{
  public String shipType;

public String getShipType(){
  return shipType;
  } 
  public void setShipId(int ShipTypeId){
  this.shiptypeId=ShiptypeId; 
  }
}
mohamadreza azadi
mohamadreza azadi
5,167 Points

hey Micheal Tsaga Your variable as String and your setter parameter should be String because you set something into your variable if you want your primitive datatype as int, end of this line type +"". if you didn't want to set the data type to String

public void setShipId(String ShipTypeId){ this.shiptypeId=ShiptypeId; }