Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Basics Getting Started with Java IO

Nicholas Cawthon-Church
Nicholas Cawthon-Church
535 Points

tried to fix again

still is saying Ive done it wrong

IO.java
// I have imported java.io.Console for you.  It is a variable called console.
String firstName = console.readLine("nicholas");
String lastName = console.readLine("what is your last name?\n");
console.printf("%s",firstName);

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Nicholas;

The output that it is wanting is "First name: nicholas", given your code assigning the firstName variable to nicholas.

Post back if you are still stuck.

Happy coding,
Ken

Nicholas Cawthon-Church
Nicholas Cawthon-Church
535 Points

It's saying that the last line is wrong [console.printf("%s", firstName);]

Ken Alger
Ken Alger
Treehouse Teacher

Yes. It needs to print out "First name: nicholas", not just "nicholas". The code for that would be:

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

Make sense?

Ken

Nicholas Cawthon-Church
Nicholas Cawthon-Church
535 Points

oh wow its just that in the question they gave I thought they wanted me to print the , firstName); -Thank you very much.