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 triala g
Front End Web Development Techdegree Student 17,424 PointsCan someone hepl me, i dont know why the code is wrong?
I do exactly the challenge said, but it's not run
Console console = System.console();
String firstName = "Hung";
console.printf = ("Hung can code in Java!");
1 Answer
A Y
1,761 Pointsag,
Console console = System.console(); //This is ok String firstName = "Hung"; //This is ok console.printf = ("Hung can code in Java!"); //This is a bug It supposed to be ((console.printf("Hung can code in Java!");)))
Regards, Amir
Nick Oman
5,041 PointsNick Oman
5,041 PointsHi Hung,
You do not need to create a new console because java.io.console has already been imported. If you remove that line I believe the code will run.
A good place to run down errors is in the editor window. You can access it by clicking the editor<> button. I copied your code and received the following error when running:
variable console is already defined in method run()