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 Creating the MVP Remaining Characters

michael lee
michael lee
5,179 Points

What am I missing?

I don't understand what am I missing here?

public class Tweet {
  private String text;
  static final int MAX_CHARS;

  public Tweet(String text) {
    this.text = text;

  public String getText() {
    return text;

  public void setText(String text) {
    this.text = text;

1 Answer

hi, for the first challnage u need to declare MAX_CHARS and assign him to 140. and in the second challnage u need to create a method that gets the remaining chars available based on the text variable. the working code is this :

public static final int MAX_CHARS = 140

u need to set it to public because u want to get access to this variable outside of the class and set it to final, final prevent u to change the variable and lastly u need to set the value to 140.