Java Java Basics Getting Started with Java Strings and Variables

import java.io.Console; console saying there is an error

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 Craig\n");
        console.printf("Craig is learning how to write Java\n");

this is the text shown in the colsole. It says an error has been reaching in parsing. I'm not sure what I am doing wrong.

Gustavo Winter
Gustavo Winter
Pro Student 27,382 Points

Hi Ed Peters, i reproduce your code exactly like is here.

The parsing error:

Introductions.java:9: error: reached end of file while parsing                                   
        console.printf("Craig is learning how to write Java\n");                                 
                                                                ^                                
1 error 

When you get a parsing error means that you have a open brackets {.

For fix this problem you have to close the two open brackets in your code.

Like this:

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 Craig\n");
        console.printf("Craig is learning how to write Java\n");
    }  // < ---- Here is the public static void main end brackets.
} // < -- This is the public class Introductions end brackets.