Java Java Basics Using your New Tools Multiple Strings

Joseph Duncan
Joseph Duncan
455 Points

TreeStory.java:18: error: reached end of file while parsing

Any help is appreciated. Thanks

Joseph Duncan
Joseph Duncan
455 Points

public static void main(String[] args) { Console console = System.console(); /* Some terms: noun - Person, place or thing verb - An action adjective - A description used to modify or describe a noun
Enter your amazing code here! */ String name = console.readLine("Enter your name: "); String adjective = console.readLine("Enter an adjective: "); console.printf("%s is very %s", name, adjective);
}

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 48,730 Points

You may have a missing closing curly bracket. Here is the complete code:

import java.io.Console;

public class TreeStory {

    public static void main(String[] args) {
        Console console = System.console();
        /*  Some terms:
            noun - Person, place or thing
            verb - An action
            adjective - A description used to modify or describe a noun
            Enter your amazing code here!
        */
      String name = console.readLine("Enter your name: ");
      String adjective = console.readLine("Enter an adjective: ");
      console.printf("%s is very %s", name, adjective);

    } 

}
Joseph Duncan
Joseph Duncan
455 Points

Thanks. I added one and it is still coming up with the same error message.

import java.io.Console;

public class TreeStory {

public static void main(String[] args) {
    Console console = System.console();
    /*  Some terms:
        noun - Person, place or thing
        verb - An action
        adjective - A description used to modify or describe a noun          
     Enter your amazing code here!
     */
  String name = console.readLine("Enter your name:  ");
  String adjective = console.readLine("Enter an adjective:  ");
  console.printf("%s is very %s", name, adjective);   

}

}