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

How do you use the getter method with a public static final String member variable?

HI, After declaring a class Spaceship, I've been instructed to declare a public String member variable shipType, thereafter i am supposed to use the getter method to return value of shipType.

Spaceship.java
public class Spaceship{

  public static final String shipType ="ShipType";
  public String getshipType(){
  return shipType;
  }

}
mongst
mongst
10,423 Points

Spoiler Alert:

public class Spaceship{
    public String shipType; 

  public String getShipType(){
     return shipType; 
  }

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