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 trialShanmukh Challa
795 PointsI don't know what to return
The compiler is saying that I need to return something for the code to be correct, but I haven't created any array or variables that would expect me to return anything.
public class PictureBook
{
public String mTitle()
{
return ;
}
}
2 Answers
aakarshrestha
6,509 PointsIt looks like you are creating a method mTitle, which returns a string value. If your intention is to create a member variable to store data in it, all you have to do is:
public class PictureBook {
//define a string member variable
String mTitle;
}
Then later you can create a getter and a setter for the string 'mTitle'.
Hope it make sense!
Happy Coding!
Cindy Lea
Courses Plus Student 6,497 PointsTheyre not asking you to return anything. Just create a class & a string, thats it.