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 trialkatrind
2,841 PointsJava Challenge
What am I doing wrong? This is extremely frustrating.
String firstName = "Momzy";
//thisIsAnExampleOfCamelCasing
console.printf("Hello, my name is %s\n", firstName);
console.printf("%s is learning how to write Java\n", firstName);
console.printf("%s can code in Java\n", firstName);
2 Answers
Katie Wood
19,141 PointsHello there,
I think there's just an issue here with the challenge looking specifically for the line it asked you to print, and no more. Since your code is printing three lines and it only asks for one, I think it's just throwing things off. When I remove the two lines it doesn't ask for and just leave the one it does, it passes - you're using the %s correctly.
Final should look like this:
// I have setup a java.io.Console object for you named console
String firstName = "Momzy";
//thisIsAnExampleOfCamelCasing
console.printf("%s can code in Java\n", firstName);
katrind
2,841 PointsThank you so much! This worked. I am so grateful.
Raffael Dettling
32,999 PointsOnly use the last last printf and donΒ΄t forget the ! after Java :)
katrind
2,841 PointsThank you very much. This helped a lot.
katrind
2,841 Pointskatrind
2,841 PointsBummer! Make sure you add the
%s
formatterWhat the heck?