Java Java Basics Getting Started with Java IO

I do not understand what i am doing wrong with this problem.

Can someone please give me the correct way to type this?
String firstName = console.readLine("cory");
String lastName = console.readLine("Brown");
console.printf("First name:  %s");

1 Answer

Sean M
Sean M
Treehouse Moderator 6,421 Points

Hello. I have solved this using a Java IDE. I hope this helps.

    String firstName = "Cory";
    String lastName = "Brown";

    System.out.printf("FirstName: %s",

first name is a string named cory. last name is a string named brown.

System.out is used to print the method. print f is used, opposed to println, because you are referencing the first name.

%s means insert first name here, making sure to include firstName outside the quotations.