Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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; }