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

i ran my code for this challenge in my workspace and it compiled but im getting errors in the output html on the answer

Java

Name.java
Import java.io.console;

Public Class;
Introductions {

    publicStaticVoid;
        main(String[] args) 
        {
        Console console = System.console();
        String firstName = "Dorcas";
        console.printf("My name is %s\n", firstName);
        console.printf("%s loves Java Programming\n", firstName);

  }
}

3 Answers

Stone Preston
Stone Preston
42,016 Points

you dont need to include the entire class file, main method, etc, just the code the task asks for.

task 1 states: Define a string variable named firstName that stores your name. Set the value to your name.

and you wrote:

String firstName = "Dorcas";

which is correct, but just take out all the other code so that the only code in the in the challenge window is

String firstName = "Dorcas";

thank you i tried ths at first i think i left out the semi colon ;

thanks so much

Stone Preston
Stone Preston
42,016 Points

no problem glad I could help