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

Aldrich Alviar
Aldrich Alviar
2,745 Points

console.printf help

please help on task #3 console.printf

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

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey there Aldrich,

The problem is just a little typo. You have an extra quotation (") mark after firstName. Just delete that and you're good to go.

console.printf ("Hello, my firstName is %s\n", firstName); // deleted quotation mark

:dizzy:

Seth Kroger
Seth Kroger
56,413 Points

You have a stray quote mark after firstName that you should have there. It's possible the challenge doesn't like the space between printf and (). While it is legal syntax, it's a strong convention in Java to leave no space between a method name and the parentheses. And I know there are a challenge or two where it matters and this is one of them IIRC.