Java Java Basics Getting Started with Java IO

August Erisman
August Erisman
100 Points

How do I do this section I don't know what this is telling me to do.

I need help and the thing didn't tell me what to do so I need your help.
// 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 name?  ");

1 Answer

Liam Clarke
Liam Clarke
Treehouse Moderator 19,804 Points


So far you are correct, the next step is asking you to print the firstName to the console, using the console method.

// Step 1
String firstName = console.readLine("What is your first name?");
// Step 2
String lastName = console.readLine("What is your last name?");
// Step 3
console.printf("First name: %s", firstName);