Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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