Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Basics Perfecting the Prototype Conditional ints

System.out.println not working?

Ok, this should be a super brain dead easy problem. Just need to say if party is less than 4, "Your table is ready."

Here's my code

int numberOfPeople = 3;

if (numberOfPeople < 4) {

System.out.println("Your table is ready");

}

JavaTester.java:129: error: cannot find symbol System.out.println("Your table is ready"); ^ symbol: variable out location: variable System of type MockSystem 1 error

When I put it into an IDE, it compiles just fine. Granted, I don't have the main class or anything like that. But, the first part of the problem was just to give the variable a name. If it required all of that, that part would've failed also.

Conditional.java
int numberOfPeople = 3;

if (numberOfPeople < 4) {

  System.out.println("Your table is ready");

}

JavaTester.java:129: error: cannot find symbol System.out.println("Your table is ready"); ^ symbol: variable out location: variable System of type MockSystem 1 error

1 Answer

Caleb Kemp
Caleb Kemp
12,677 Points

Ok, what it is, is the challenge asked you to print to the console, something like console.printf(""), and you were using the System.out method. Now if you use the console.print method, and you click "preview", it still claims there are errors? Why is that? Well, online IDE's don't give users access to the console, so when you use it, it squaks "console" is undefined. However, if you write it correctly, and hit "check work", it will pass. Hope that helps!