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 trialEric Esparza
328 PointsJava Basics Challenge Task 3 of 3 Treehouse is telling me to change <yourname>...so I do...ThenTreehouseTellsMeNotTo
the task is asking me to change <YOURNAME> using the string variable. So...I change it and Treehouse tells me not to change the console.printf. Is there something I'm missing? Am I supposed to add another line of code? Reset the code?
Here is my code:
String firstName= "Eric"; console.printf (%s can code in Java! \n", firstName);
// I have setup a java.io.Console object for you named console
3 Answers
Deividas Strioga
12,851 PointsHey Eric, it seems you are missing first quote mark in the beginning of brackets, just before %.
Rory Wagner
2,593 PointsIs the 2nd piece of code from console onward, on a new line in the terminal? May be a formatting thing...
Brody Ricketts
15,612 Points// Task 2 of 3
String firstName = "Brody";
console.printf("Brody can code in Java!");
// Task 3 of 3
String firstName = "Brody";
console.printf("%s can code in Java!\n", firstName); // Remember to wrap your print line in quotes :) Happy coding.
These 2 blocks of code completed the challenge for me. Check for other syntactical errors or typos. Post your code using the information provided in the Markdown Cheatsheet and we will be able to better assist you.
Reference the Markdown Cheatsheet when posting code. Syntax coloring helps wonders when trying to debug as well as other debugging practices.
Eric Esparza
328 PointsEric Esparza
328 PointsI have the "" in the code.... Treehouse is still telling me the same thing. ( I missed the 1st " when I posted the question)
What did you do to pass 3 of 3?
Thanks,
Eric