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

Android Build a Simple Android App Improving Our Code Creating a New Class

Tremayne Clinton
Tremayne Clinton
5,417 Points

Now what am I doing wrong

/PictureBook.java:2: error: class, interface, or enum expected public String mTitle() ^ 1 error

PictureBook.java
public class PictureBook{}
public String mTitle()

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey there,

First, I deleted your duplicate question for the same topic in the Community. You sometimes need to be patient before someone helps provide an answer instead of posting duplicate questions.

As for your question, there are a few issues.

  1. (member) variables do not have parenthesis after them, only methods do.
  2. Besides the parentheses, your declaration of the member variable is correct, but it is not inside the class as the instructions asked.
  3. Don't forget the semi-colon to end the variable declaration statement.

Just fix that up and you're good to go. :)

Keep Coding! :dizzy: