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

Don't understand the question of what to replace. Am I going to make a new string to replace <YOUR NAME>?

I have changed <YOUR NAME> with a different name which caused error. I have deleted "%s" and replaced it with <YOUR NAME> which caused an error but I need to keep the printf line intact. I'm definitely unsure about the question being asked.

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

2 Answers

Hey Travis,

The prompt is asking you to create a variable, called firstName, which is assigned to some name. You'll then be asked to print, "(Some name), can code in Java!," using the printf method.

String firstName = "Jacob";
console.printf("%s can code in Java!", firstName);
Eric Hodgins
Eric Hodgins
29,207 Points

You just want your output to be "Travis can code in Java!". Right now it's printing "<YOUR NAME> can code in Java". You'll have to adjust the firstName variable and then do something like this:

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

Hopefully that helps!