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

Charles Sylvester
Charles Sylvester
393 Points

Now replace <YOUR NAME> in the console.printf expression with the firstName variable using the string formatter.

I've done this but it keeps giving me the message "Bummer! Please make sure to leave the printf statement intact!"

Name.java
// I have setup a java.io.Console object for you named console;
String firstName = "Charles";
console.printf ("%s can code in Java!", firstName);
Kumar Bharath H N
Kumar Bharath H N
8,324 Points

Hi charles,

you have to leave the 2nd printf statement intact with your name hard-coded in the printf statement. the printf statement you have will be the 3rd line of your code.

Hope this helps :)

Happy coding! kumar

Kumar Bharath H N, you're meant to replace the printf statement in the 2nd part of the challenge with a new statement. You shouldn't have both.

1 Answer

You only need to remove the space between printf and the parenthesis.

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