Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Basics Getting Started with Java IO

Challenge issues, Getting Started with Java, Receiving Input Challenge 3/4

On challenge 3/4 I receive the following error:

Challenge title: Print out to the screen using the printf method on console, "First name: " and the user's first name.

Error: Bummer! Did you forget to pass the firstName parameter to the printf function?

Here is my code:

String firstName = "";

String lastName = "";

console.readLine("What is your first name?:  ", firstName);

console.readLine("What is your last name?:  ", lastName);

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

Where am I going wrong?

Thanks,

Justin

Ken Alger
Ken Alger
Treehouse Teacher

Edited for markdown.

Steven Jara
Steven Jara
914 Points

I'am also stuck with this , its really confusing.

3 Answers

I passed with this

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

console.printf("First name: %s", firstName);
Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Hmmm... check the syntax on those console.readLine statements. They return the String that was inputted.

Thanks guys, that was it.