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! While you're at it, check out some resources Treehouse students have shared here.

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 Adding a Custom Constructor

Matthew Williams
Matthew Williams
3,103 Points

I need help.

I'm just lost on this lesson. It doesn't help that I have no idea what constructors are (I understand they have no return types) but Udacity and Treehouse don't put these things in layman terms.

Any help and a description of constructors in 20 words or less would be extremely helpful.

Spaceship.java
public class Spaceship {
    public String shipType;

  public ship

    public String getShipType() {
      return shipType;
    }

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

2 Answers

Also I encourage you to take any of java basic courses beside the android track that would help you alot.