Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,631 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: