Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
rydavim
18,785 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!