Welcome to the Treehouse Community
Looking to learn something new?
I am constantly getting the "Ensure you included the string formatter '%s'" error, is my syntax incorrect?
From my knowledge this is used properly but is erroring out, have I made a mistake I cannot spot?
// I have imported java.io.Console for you. It is a variable called console. String firstName = console.readLine(); String lastName = console.readLine(); console.printf(String.format("First name: %s",firstName));
Matthew Hardy4,063 Points
The method printf allows for a formatted string to be directly entered into it, you have no need for String.format. Simply typing console.printf("First name: %s",firstName); will get the job done with no problems!
Jason AndersTreehouse Moderator 145,624 Points
I'm not sure why you added
String.format() to the
console.printf() call. "printf" itself is used to print a formatted string. So, just delete that extra code and you're good to go.
console.printf("First name: %s",firstName);
Keep Coding! :)