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

what doesn't it like about this: String firstName = "Brenda"; console.printf("%s", firstName);

what doesn't it like about this?

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

1 Answer

Your string is just "%s". If you printed out just "%s" with a parameter of your name (like what you did), all it would print out is "Brenda". Let's say I wanted to print out a string (for me!) in Java:

Note this isn't the answer to the question this is just a demonstration! This is just a hint. You must find the answer on your own! :)

// I have setup a java.io.Console object for you named console
String firstName = "Alex";
console.printf("%s likes to code in Python", firstName);

That was a hint. Don't try that out as your answer because it would say "Bummer"! You must find out the answer on your own.

Good luck! I hope this helps, Alex