Java Java Basics Getting Started with Java IO

// I have imported for you.  It is a variable called console.

String firstName = console.readLine("What is your name?");

String lastName = console.readLine("What is your last name?");

console.printf("First name:" + %s  );

2 Answers

Steven Parker
Steven Parker
201,957 Points

The replacement token needs to be inside the template string, and the value to fill it with must be supplied as an additional argument:

console.printf("First name: %s", firstName);

Thank you very much Steven