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 trialJoyce Chidiadi
1,867 PointsMy 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?
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
17,610 PointsHey 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.
Filipe S Jonson
10,381 Pointspublic 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
1,867 PointsOkay. I added m everywhere possible except at the location for the getters and setters and it worked. Thank you again, Jackson.
Joyce Chidiadi
1,867 PointsJoyce Chidiadi
1,867 PointsI 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.