Java Java Basics Getting Started with Java IO

Challenge task 3

Here is the question. What am I doing wrong?

Using the console's printf method, display a message that says, "First name: ", followed by the first name that the user has entered.
// I have imported for you.  It is a variable called console.
String firstName = console.readLine("what is your first name?  ");
String lastName = console.readLine("what is your last name?  ");
console.printf("First name: ");
console.printf("%s", firstName);

1 Answer

The challenge wants "First name: ", followed by the first name with a single printf statement. You're doing it with two.