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

D Din
PLUS
D Din
Courses Plus Student 208 Points

What am I supposed to write here since I don't see a console ? Please help

What should I write here please help it says Call the printf method on the console object and make it write out "<YOUR NAME> can code in Java!"

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

3 Answers

Judy Radloff
Judy Radloff
4,888 Points

Sometimes to properly clear a challenge they want you to print out exactly what they asked for. The directions say "Call the printf method on the console object and make it write out "<YOUR NAME> can code in Java!"." Essentially everything is already hooked up for you and they want you to print out the sentence "Ben can code in Java!" Just change what you have in the printf method a bit and it should run.

Pedro Araya
Pedro Araya
1,912 Points

Just write ypur name :D or any name.

ola cherni
ola cherni
494 Points

it should be.. console.printf ("%s\n", firstName);