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

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,754 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!