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

Elvin Roldan
Elvin Roldan
1,473 Points

Cant seem to implemnt printf Method in Task 2 (lesson 1). console.printf("%s is Coding, firstName");

I have this code for Task 2, but it always returns a syntax error. i checked and view the video for errors but I cant find the errorin the syntax consecuently cant continue with the next task.

String firstName = "Elvin";

console.printf("%s is Coding, firstName");

Name.java
// I have setup a java.io.Console object for you named console

String firstName = "Elvin";

console.printf("%s is Coding", firstName);

3 Answers

Fahad Mutair
Fahad Mutair
10,359 Points

hi Elvin Roldan , you don't have syntax error but he's askin you to type exactly same message

make it write out "<YOUR NAME> can code in Java!"

Elvin Roldan
Elvin Roldan
1,473 Points

Thank you for the help, your wright my action didn't match the instructions.

Michael Walker
Michael Walker
45,428 Points

Hi Elvin,

You definitely do not have a syntax error. The problem is your output doesn't match the output of what the challenge is. Simply change the portion of your printf method from "is Coding" to "can code in Java!" and you will pass just fine.

Elvin Roldan
Elvin Roldan
1,473 Points

Thanks for the help definitely wright more careful next time with the instructions.