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

Jorge Ponce
Jorge Ponce
2,003 Points

Next, we need getter and setter methods for our member variable. Let's start with the getter method. Add a method to get

i dont now try to make the best method and everthing error error help with this

Spaceship.java
public class Spaceship {
   public String shipType;
 public String getshipType() {
   return shipType;
 }

}

1 Answer

andren
andren
28,469 Points

The only issue with your code is the name of the getter method. The name of the getter has to be written in camelCase, meaning that every word other than the first one is capitalized. So instead of getshipType the name should be getShipType.

If you fix that name like this:

public class Spaceship {
  public String shipType;

  public String getShipType() {
    return shipType;
  }
}

Then you'll be able to pass task 3.

Jorge Ponce
Jorge Ponce
2,003 Points

Thanks i dont see the letter small thanks thanks.