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 Conditional ints

Conditional.java Challenge Task 1

I don't understand what is needed to be done

Conditional.java
int numberOfPeople = "3";
if (numberOfPeople < 3)

1 Answer

Tabatha Trahan
Tabatha Trahan
21,422 Points

The challenge is asking you to add a statement to the conditional (if statement). So if the number of people is less than 4, print out to the console "Your table is ready". It looks like you'll be using the console.printf method for this challenge. Make sure to open the block of code containing your print statement with an opening curly brace, and close it with the closing curly brace. The if statement is comparing the value of your numberOfPeople variable to the number 4. If this condition is true, you will execute the block of code that follows your condition statement. If the condition is false, the program will skip that block and continue on. Post here if you run into any issues. It also helps a lot to follow along with the videos by using workspaces since the concepts reviewed in the videos are very similar to what the challenges ask for. I hope this helps.