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

Raul Faure
Raul Faure
596 Points

What am I missing? JavaTester.java:73: error: illegal start of expression public class Name { ^ 1 error

JavaTester.java:73: error: illegal start of expression public class Name { ^ 1 error

Name.java
  public class Name {

  public static void main(String[] args) {

      String firstName = "Raul";

    console.printf("firstName");


  }
}

1 Answer

Mike Papamichail
Mike Papamichail
4,883 Points

I don't know if this will help but i got two suggestions :

1) Try writting the main... line like this :

public static void main(String args[]) {} // watch that instead of String[] i'm writting args[]

2) I guess that in your program you just want to output the firstName variable.If that's true, then remove the "" marks because if you run your program like that, you'll just output the string "firstName" and not Raul!

Let me know if the 1st suggestion worked!