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

Jasper Allijn
Jasper Allijn
2,743 Points

Did you forget to pass the `lastName` parameter to the printf function?

So I've been cracking my brain over this and can't seem to see where I am going wrong. It's exactly the same as the 'firstName' challenge. What am I doing wrong her?

IO.java
String firstName = console.readLine("What Is Your First Name:  ");
console.readLine(firstName); // remove this
console.printf("First name: %s/n", firstName);

String lastName = console.readLine("What Is Your Last Name:  ");
console.readLine(lastName); // remove this
console.printf("Last name: %s/n", lastName);

1 Answer

Hi there,

The challenge is complaining about the extra lines of code. If you remove the lines where I have added a comment in your code, you will pass the challenge. Those two lines don't add anything but they will prompt for unexpected user input which the challenge isn't expecting.

Steve.