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

Help me find mistakes , can't understand why import is wrong.

//Task = Call the printf method on the console object and make it write out "<YOUR NAME> can code in Java!"

String firstName = "Sun"; console.printf("my name is %s", firstName);

//Error Check the spelling of your argument to the printf method. Make sure it is printing out what the instructions are asking for

1 Answer

Dmitry Ponomarenko
Dmitry Ponomarenko
18,175 Points

Hey! I guess you shouldn't import anything for this task. Excercise implies that "console" object is already declared. You just need to write exactly what is asked without any other code : )

Well that solves the import problem but I'm still stuck on it. OP edit

Strings and Variables 6:24 with Craig Dennis is the lesson

Dmitry Ponomarenko
Dmitry Ponomarenko
18,175 Points

Instructions are asking to write ""%s can code in Java!", not "my name is %s". I guess that's a source of your problem.

Thanks for the help , I thought it was just a simple print your name out , should have seen the quotations.

Thanks