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

Santiago Selva
Santiago Selva
1,241 Points

I'm not sure if I understand what the quiz is asking for.

I'm writing what I understand that I have to write in the code but I keep making a mistake and I don't know what it is.

If I understand correctly, I should replace my name with a string. Sorry if a make a mistake, but I'm from Argentina and my english is not perfect.

This is what I'm writing:

String firstName = "Santiago"; console.printf("%s", firstName);

Name.java
// I have setup a java.io.Console object for you named console
String firstName = "Santiago";
console.printf("%s", firstName);

3 Answers

Santiago Selva
Santiago Selva
1,241 Points

I have just understand what the question was! Thanks!!

No prob.

Santiago Selva
Santiago Selva
1,241 Points

The challenge says: Call the printf method on the console object and make it write out "<YOUR NAME> can code in Java!"

I'm a begginers, and in the course I'm taking they haven't even taught how to write all the other codes that you wrote, so I don't think that putting the code you wrote is the correct answer. I think i'm making a mistake in the translation that i'm understanding. Thanks for the quick response!

hmm ok, try this then:

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

Perhaps it's asking for you to prompt for a first name, then use it in your printf statement. It's kind of hard to tell what it's asking if you don't post the actual task objective.

Try this out:

String firstName = console.readLine("Input first name: ");
System.out.printf("%s", firstName);

Let me know if you have any other questions.