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!

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

Anurag Gracian
Anurag Gracian
315 Points

stuck here. please help

i dont know why is it saying that my code is wrong

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

1 Answer

james south
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

you have a newline you don't need, and you are including the variable you want to interpolate in the string, when it needs to go after. the syntax is ("myString...words words...%s...more words in myString...", myVariable).