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 trialJ Meacham
932 PointsI'm on Creating a Class. Where is my error in: public class PictureBook { public String mTitle() { } }
the first line passed the challenge. It's the second one that I'm stumbling on.
3 Answers
J Meacham
932 PointsLuke, I figured it out! Substituted the second { for a semi-colon and I'm off...
Luke Glazebrook
13,564 PointsHi!
Your code looks awesome apart from one little thing. Would you usually put a set of parentheses after a variable declaration? Maybe take a look at that and don't forget to add your semi-colon!
I hope that I managed to help you out and don't hesitate to let me know if you are having any further problems with it!
-Luke
J Meacham
932 PointsThanks Luke. The set of parentheses were part of the initial instructions, without explanation. So I guess the answer here is "Yes"? I thought adding the semi-colon would then be a simple fix, but I'm still stuck even after this change (and multiple other tries, including elimination of the ()):
public class PictureBook {
public String mTitle() {
}; }
J Meacham
932 PointsP.S. The only error I'm getting with the code below is:
./PictureBook.java:3: error: ';' expected public String mTitle { ^ 1 error
J Meacham
932 PointsCHANGED CODE:
public class PictureBook {
public String mTitle {
}; }
If I place the () back into the code, I get this error:
./PictureBook.java:5: error: missing return statement }; ^ 1 error
Aarg. Any ideas Luke?
Joshua marais
2,955 PointsHello tri putting a ; at the end of mTitle.