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 and Variables

In workspace , when compiling it says :Introductions.java:10: error: reached ent file while parsing

Introductions.java:10: error: reached end of file while parsing
}
^
1 error

5 Answers

Could you post your code? You are missing a closing curly brace somewhere.

import java.io.Console;

public class Introductions {

    public static void main(String[] args) {
        Console console = System.console();
        // Welcome to the Introductions program!  Your code goes below here
      console.printf("Hello,my name is String\n") ;
      console.printf("craig is learning how to write Java\n");        
    }

[MOD: edited code block - sh]

Yeah you are missing the last bracket at the very end.

import java.io.Console;

public class Introductions {

    public static void main(String[] args) {
        Console console = System.console();
        // Welcome to the Introductions program!  Your code goes below here
        console.printf("Hello,my name is String\n") ;
        console.printf("craig is learning how to write Java\n");        
    }
}

thank you

No problem - missing semi-colons, brackets, and spelling errors are some of the easiest mistakes to make when programming and they can be hard to catch sometimes. :p

Excuse me can you tell me for what we use //

Yes. Simply put // is the beginning of a line comment, anything after the // is ignored by the compiler - it is simply used to help the person writing the code to more clearly understand what is going on. There is also a multi-line comment which does the same thing but can span multiple lines, it looks like this:

/* This
* is a
* multi-line comment.
*/

thank you a lot , I'm a beginner in java . Do you think that java is the perfect programming language to build android appps ?

It's essentially the only language for building Android apps. If your desire is to build Android apps then I think the best course of action would be take the Java Basics course and maybe the Java Objects course and then begin on the Android Development track.

thanx