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

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.