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 trialJustin Steenwerth
4,806 PointsChallenge 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
Steven Jara
914 PointsI'am also stuck with this , its really confusing.
3 Answers
Juan Gallardo
1,568 PointsI 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
Treehouse TeacherHmmm... check the syntax on those console.readLine
statements. They return the String
that was inputted.
Justin Steenwerth
4,806 PointsThanks guys, that was it.
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherEdited for markdown.