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

Java Basics

String firstName ="Ary de Oliveira estudante at treehouse web desing"; console.printf("Hello, my name is %s\n", firstName); console.printf("%s is learning how to write Java\n", firstName);clear

i need help i do not see the error please.

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

        String firstName ="Ary de Oliveira estudante at treehouse web desing";
        console.printf("Hello, my name is %s\n", firstName);
        console.printf("%s is learning how to write Java\n", firstName);clear

3 Answers

Christopher Augg
Christopher Augg
21,223 Points

Ary de Oliveira,

Here is an example and explanation for each task according to their instructions:

// Task 1: Only assign a String of your first name here
String firstName = "Christopher";
// Task 2: add a new line to print out the String "<YOUR NAME> can code in Java!"
String firstName = "Christopher";
console.printf("Christopher can code in Java!");
// Task 3: Change the print statement in Task 2 so that your name 
// is replaced by the variable firstName using the string formatter %s. Do not add a new line.
String firstName = "Christopher";
console.printf("%s can code in Java!", firstName);

You also had the word clear on your last line. You would not want that in your code.

Hope this helps.

Regards,

Chris

Best Answer thank you Chris.

thanks for the help Ary