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
Bretney Scott
20,319 PointsIt'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 < 4) {
console.printf("Your table is ready ");
}
And it's still not working.
4 Answers
Ken Alger
Treehouse TeacherBretney;
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
Treehouse Guest TeacherI just said that :)
Robert Manolis
Treehouse Guest Teacheryou 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.
Bretney Scott
20,319 PointsI will start reading directions slower from now on. Thanks very much to all. :)
Myers Carpenter
6,421 PointsThe only two places that you use < for < is in an HTML document or a XML document. Not in Java code.
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherSorry Bretney I updated the hint that you saw that told you to use the
<symbol. It now reads<as it should. Thanks for pointing out the bug!