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

It's not working

Add an if statement to see if there are less than 4 people. Then write out to the console, “Your table is ready”

Here's my code:

int numberOfPeople = 3;
  if (numberOfPeople > 4) {
      console.printf("Your table is ready ");
  }

then I got:

Bummer! Make sure your if statement is checking less than 4 using the < symbol.

I put that in:

int numberOfPeople = 3;
if (numberOfPeople &lt; 4) {
      console.printf("Your table is ready ");
  }

And it's still not working.

Craig Dennis
Craig Dennis
Treehouse Teacher

Sorry Bretney I updated the hint that you saw that told you to use the &lt; symbol. It now reads < as it should. Thanks for pointing out the bug!

4 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Bretney;

You selected the incorrect comparison operator >. The question asks you to set it for when it is less than ( < ) four people. You have it set for greater than.

Ken

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

you don't have to code the symbol, just use the right one, my friend. in your original code, you used the greater than symbol, you wanted to use the less than symbol. Don't feel bad, it happens all the time. cheers.

I will start reading directions slower from now on. Thanks very much to all. :)

The only two places that you use &lt; for < is in an HTML document or a XML document. Not in Java code.