Java Java Objects Creating the MVP Remaining Characters

Blessed Mupatsi
Blessed Mupatsi
764 Points

Add a new constant that defines the max chars allowed and set it 140. Use proper case for constants. Ensure it is access

I can't understand this

Tweet.java
public class Tweet {
  private String text;

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

  public String getText() {
    return text;
  }

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

}
int MAX_CHARS = 140;

 public static final int MAX_CHARS = 140; {
   int MAX_CHARS = 140;
 }

1 Answer

You got it right. You only need, "public static final int MAX_CHARS = 140;" and put that line of code above "private String text; "