Using the console's printf method, display a message that says, "First name: ", followed by the first name that the user
confused what i am doing wrong
// I have imported java.io.Console for you. It is a variable called console. String firstName = console.readLine ("kunal"); String lastName = console.readLine ("Grover"); Console.printf("%s\n,first name");
Heidi FryzellFront End Web Development Treehouse Moderator 20,612 Points
You are very close.
The message that is printed to the console is the format string, it is the first parameter that is passed to printf. That string needs to output "First Name: Kunal". I think you might have gotten confused because you did not realize that "First Name:" needed to be part of the format string.
The variable, firstName, is the second parameter passed to printf, and it will replace the format specifier %s in the format string.
Notice how the 2 parameters passed to printf in parenthesis, the format string and the variable, are separated by commas.
Notice how the format string is surrounded by quotes but the variable, firstName is not.
console.printf("First name: %s\n", firstName);
This video goes over all these concepts: https://teamtreehouse.com/library/strings-and-variables
Happy Coding! Heidi