Java Java Basics Getting Started with Java Receiving Input

I followed the steps for the "what is your name" prompt but when I press enter I keep getting "Hello my name is ...

Is it possible for me to restart the workspace from scratch? I think I may have missed a step

2 Answers

rydavim
MOD
rydavim
Treehouse Moderator 18,368 Points

Before starting over from scratch, remember you can always ask our helpful community to take a look at your code. But if you'd like to go back to the beginning...

This is the starting code for that video:

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
        String firstName = "Ben";
        //thisIsAnExampleOfCamelCasing
        console.printf("Hello, my name is %s\n", firstName);
        console.printf("%s is learning how to write Java\n", firstName);
  }
}

You can also launch a fresh copy of any workspace template with the following steps:

  1. Click the Launch Workspace button at the bottom right of the video.
  2. Instead of clicking the green Launch it! button, click over to the grey link that says Launch Different Workspace.
  3. From this page, create a new workspace.
  4. From the last drop down, select the template you'd like to use. In this case, Getting Started with Java - Receiving Input.

Let me know if you have any questions, and happy coding!

Great, managed to launch a fresh copy of the workspace and follow the steps again without encountering any of my previous challenges. Thank you for the advice!