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 Basics Perfecting the Prototype Parsing Integers

Blaise Durbin
Blaise Durbin
402 Points

Always 13 and under.

No matter what it always says that I need to be 13 or older.

  String ageAsString = console.readLine("How old are you?  ");
  int age = Integer.parseInt(ageAsString);
  if (age < 13);  {
    //Insert Exit Code
    console.printf("Sorry you must be at least 13 to use this program.\n");
    System.exit(0);
  }

[All of them are on the same lines as they are in the video in case this message makes it look like they aren't.]

What is wrong with this that is making it always say that I'm always under 13 no matter what I type in?

Blaise Durbin
Blaise Durbin
402 Points

I added a ; after the 13.

Christopher Brewer
Christopher Brewer
326 Points

I am having this issue too ... did you find a resolution?

1 Answer

Hi Blaise Durbin,

It looks like you don't need the ;, because if statements don't need them.

Let me know if it helps, ISAIAH S