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

Java Java Objects (Retired) Creating the MVP For Each Loop

jinhwa yoo
jinhwa yoo
10,042 Points

I think it is difficult...

help me

jinhwa yoo
jinhwa yoo
10,042 Points

Welcome to a little Twitter-like application. Here I'm modeling a Tweet. It has text which is the body of the tweet. All Tweets have a maximum character limit of 140 characters.

Please add a new constant to store the maximum number of characters allowed which is 140. Use the proper access level modifiers to make it unchangeable and accessible right off of the class. Follow the proper naming convention.

Chris Freeman
Chris Freeman
Treehouse Moderator 68,426 Points

The View Challenge link above is for the Scrabble Hand Challenge. Your question is about the challenge Remaining Characters

3 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

The challenge Remaining Characters asks: Please add a new constant to store the maximum number of characters allowed which is 140. Use the proper access level modifiers to make it unchangeable and accessible right off of the class. Follow the proper naming convention.

Breaking this down:

Please add a new constant to store the maximum number of characters allowed: a "constant" implies to use an ALL CAPS variable name. The exact name is not specified. Let's use MAX_CHAR. "number of characters" implies this will be of type int:

int MAX_CHAR;

which is 140.: this is our initial value:

int MAX_CHAR = 140;

Use the proper access level modifiers to make it unchangeable...: implies using final keyword:

final int MAX_CHAR = 140;

...and accessible... implies public keyword:

public final int MAX_CHAR = 140;

...right off of the class.. implies `static keyword:

public static final int MAX_CHAR = 140;

Follow the proper naming convention.: A reminder to use ALL CAPS variable name

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Jinhwa;

Welcome to Treehouse!

What is your question exactly? More than happy to assist.

Happy coding,
Ken

jinhwa yoo
jinhwa yoo
10,042 Points

Welcome to a little Twitter-like application. Here I'm modeling a Tweet. It has text which is the body of the tweet. All Tweets have a maximum character limit of 140 characters.

Please add a new constant to store the maximum number of characters allowed which is 140. Use the proper access level modifiers to make it unchangeable and accessible right off of the class. Follow the proper naming convention.