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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Angie Rodriguez](https://secure.gravatar.com/avatar/9518ed2f89b48d19f3874f620f014cc1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Angie Rodriguez
410 Points"First name: " io java. I swear my code looks correct, but I keep getting an error message. What am I doing wrong?
I do not understand what else I need to do to move past this exercise. I reviewed the video, and matched the syntax to the instructor's. Why isn't this code working?
I keep getting this error:
Bummer: Did you forget to pass the firstName
parameter to the printf function?
My code looks like this:
String firstName = "Angie";
console.readLine(firstName);
String lastName = "Rodriguez";
console.readLine(lastName);
console.printf("First name: %s", firstName);
2 Answers
![Mark Sebeck](https://uploads.teamtreehouse.com/production/profile-photos/6569772/micro_mark.jpg)
Mark Sebeck
Treehouse Moderator 37,777 PointsHi @Angie Rodriguez . Remember to always ask your questions from the question or video (by pressing the "Get Help" button) so others can easily look at the video or question. I included the link here for others.
So the short answer is nothing is wrong with your printf but with your readLine. The answer checker should not have passed your first exercise. Remember the readLine method returns the user input. So you have to set a variable = to the readLine. Like this:
String firstName = console.readLine();
While not required for this exercise but inside the () for readLine you put a message to the user. So in a real example you would want to put something like
String firstName = console.readLine("Please Enter your first name: ");
But i would not suggest doing that here since adding extra code sometimes confuses the checker. I just thought that explaining that would make it more clear how the readLine works.
Keep at it Angie Rodriguez and good luck!
![Angie Rodriguez](https://secure.gravatar.com/avatar/9518ed2f89b48d19f3874f620f014cc1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Angie Rodriguez
410 PointsThank you Mark, I realized my mistake after I submitted this question, but appreciate the detailed explanation.