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!
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
Logan Joseph39 Points
String firstName = "Logan"; console.printf("Logan can code in Java!"); console.printf("%s can code in Java!");
%s won't replace my name
// I have setup a java.io.Console object for you named console String firstName = "Logan"; console.printf("Logan can code in Java!"); console.printf("%s can code in Java!");
Jennifer NordellTreehouse Teacher
Hi there! You're close here. Only one
printf statement is needed. You've set up a variable that's storing your first name, so we want to use that. Remember, that good coders are inherently sort of lazy. We want the computer to do as much work for us as we can.
So your last line should look like this:
console.printf("%s can code in Java!", firstName);
%s tells Java to insert the value of a string type variable at this point in the string. But you still have to tell it which variable to use there. You might have lots of string variables in your code.
Hope this helps!