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's mean""Call the printf method on the console object and make it write out "<YOUR NAME> can code in Java!" "" ???

I was tested everything

// Welcome to the Introductions program!  Your code goes below here
String firstName = "java";
console.printf("Hello my name is %s\n", firstName);
console.printf("I'm %s\n", firstName);

4 Answers

You're on the right track - just a couple of tweaks and you're sorted.


String firstName = "Arezki";
console.printf("%s can code in Java!", firstName);

Sorry, that's the last step ... but you see what it is trying to do.

The second step is literally as it says in the question:

String firstName = "Arezki";
console.printf("<YOUR NAME> can code in Java!");

The last step then substitues the <> for your name stored in the initial variable.

I hope that makes sense!!


Thank you.

No problem - keep it up and if you come across problems, just shout in the forum and someone will come to help. :-)


i am having the same problem please help

String firstName = "your name"; console.printf("%s can code in Java!", firstName);

Didactic Exemplo and correct

first question String fisrtName ="Ary";

second question

console.printf("Ary can code in Java");