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 Strings, Variables, and Formatting

Help Required Please!!!!!! as far as i can tell I am coding it right. Help please

is this a bug or am i missing something here???????

// I have setup a java.io.Console object for you named console
String firstName = "Andy";
console.printf ("%s can code in Java", firstName);

2 Answers

Well, you are missing a '!' at the end of the console.printf's format string. Here's a solution:

String firstName = "Srikar";
console.printf("%s can code in Java!", firstName);

thanks for the quick reply. have just worked that out after having to go back and redo it for about the 5th time. the thing that threw me was that i had missed the "!" on task 2 and it passed it.

thank you

Welcome, Andy.

you are all right about the space after printf aswell.

have just redone task 2 again with both a space after printf and no "!" and it still passes.

It is no wonder i was struggling with it......

Anyway Thank you to you all, as you were all right...

Anjali Pasupathy
Anjali Pasupathy
28,883 Points

You've nearly got it. You just need to get rid of the space right after "printf".

console.printf("%s can code in Java", firstName);

I hope this helps!