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

why this program givin the error illegal start of expression "public class introduction"

public class Introductions { public static void main(String[] args){ Console console = System.console(); String firstName = "rahul"; console.printf("my firstname is %s\n", firstName); console.printf("%s started a project java \n",firstName); } }

Name.java
public class Introductions 
{
      public static void main(String[] args){
        Console console = System.console();
        String firstName = "rahul";
          console.printf("my firstname is %s\n", firstName);
          console.printf("%s started a  project java \n",firstName);
      }
    }

2 Answers

Hi Rahul Panda, in this Code Challenge, it looks like you don't need these lines:

public class Introductions {
public static void main(String[] args) {
Console console = System.Console();
}
}
Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Yeah in Java Basics, you don't need to worry about the class wrapper. It's just noise at this point of the game. Sorry for the confusion.