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
David Renger
934 Points"Override an inherited method" problem with adding in the quotes ""
This is the code I added. I have to escape the quotes so that with the title it will actually add the quotes like this: Blogpost: "My titleeeeeee" by Me.
@Override public String toString() { return "Blogpost: \"" + mTitle + "\"by " + mAuthor; }
But it gives this error: Bummer! Make sure you follow the instructions. Received 'Blogpost: "Check this out!"by Craig Dennis' does that match what was requested?
1 Answer
Benjamin Barslev Nielsen
18,958 PointsThe challenge asks for: "BlogPost: TITLE by AUTHOR", i.e., TITLE should not be enclosed by quotes. Besides this you should also have a big P in Blogpost:
@Override
public String toString() {
return "BlogPost: " + mTitle + " by " + mAuthor;
}
David Renger
934 PointsDavid Renger
934 PointsHmm! It did work! Strange error message though... Seems to imply it wants ""Check this out!"" in "". Anyways thanks for the answer!