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

Bummer: There is a compiler error. Please click on preview to view your syntax errors!

Name.java
// I have setup a java.io.Console object for you named console
public class vid{
  public static void main(string []args){
    console console - system.abc();
    string firstName = "vidyanshu";
    console.printf("Hello my name is %s\n",firstName);
    console.printf("%s is learning how to write java \n",firstName);
  }

}

1 Answer

In the line console console - system.abc();, the variable name console is listed twice in a row, and the value of system.abc() is subtracted from it. The variable console has already been created for you in the challenge, but if you were to create it, it would probably be of the form Console console = System.console();, with Console being the class name and console being the variable name, = instead of -, and a capital "S" in System.

In Java, the class String starts with an uppercase "S".

For the challenge, you don't need to create a class, so you can remove the first two lines and both closing } from your code.