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 trialHannah Mishow
1,136 PointsProblem With Challenge in Build Simple Android App "Add a String member variable named mTitle. Make it public."
Error keeps saying ';' expected where the second curly bracket is but every time I add it, its wrong and I get no info in the preview
public class PictureBook {
public String mtitle}
3 Answers
Jeremiah Montano
7,221 PointsHi Hannah,
Your code appears to be missing a semi-colon at the end of your variable declaration. You need to end each line with a semi-colon, and then the end of your class with a curly brace. You should see something like this:
public class MyClass {
public string mMemberVariable;
}
I hope this helps solve your problem. Happy coding!
Mohit Kishore
13,935 PointsIn Java every statement must end with a ";" And a block of code in a "{}" So your solution is <code> public class PictureBook{
public string mTitle;
} </code>
MUZ140837 Trust Mubaiwa
5,597 Pointsthe statement in your class must end with a semicolon. thats where the error is emanating from:
public String mTitle;
hope this solves it
Mohit Kishore
13,935 PointsMohit Kishore
13,935 PointsI like your answer more than my own : O You didn't give the answer but you gave a solution : ) An up vote for that : )