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 a Weather App (2015) Working with JSON Creating a Model Object

Joyce Chidiadi
Joyce Chidiadi
1,867 Points

My POJO code is not passing

Hi,

I have written the getters and setters code for this challenge but it keeps telling me that "it seems the code is no longer passing". What does this mean?

Movie.java
public class Movie {
  private String Title;
  private int YearReleased;

  public String getTitle() {
    return Title;
  }

  public void setTitle(String title) {
    Title = title;
  }

  public int getYearReleased() {
    return YearReleased;  
  }

  public void setYearReleased(int yearreleased) {
    YearReleased = yearreleased;
  }

}

3 Answers

jacksonpranica
jacksonpranica
17,610 Points

Hey Joyce,

The code is looking for member variables with a "m" in front of them. For example mTitle, and mYearReleased. You don't have the m's in front. Instead you just have Title and YearReleased.

Joyce Chidiadi
Joyce Chidiadi
1,867 Points

I added m initially but still had the same problem. As the question indicated that 'm' should be ignored, I don't know why this problem persists. Will try again and see what happens. Thank you Jackson.

Filipe S Jonson
Filipe S Jonson
10,381 Points
public class Movie {
  private String mTitle;
  private int mYearReleased;

  public String getTitle() {
    return mTitle;
  }

  public void setTitle(String title) {
    mTitle= title;
  }

  public int getYearReleased() {
    return mYearReleased;  
  }

  public void setYearReleased(int yearreleased) {
    mYearReleased= yearreleased;
  }
}

your code is correct, but i think this exercise requires you to add "m" in the variables, so just change "Title" and "YearReleased" to "mTitle" and "mYearReleased"

Joyce Chidiadi
Joyce Chidiadi
1,867 Points

Okay. I added m everywhere possible except at the location for the getters and setters and it worked. Thank you again, Jackson.