Hello, World!

This is the first program you should write by yourself, from start to finish. Those of you who go on to more computing beyond this introductory course will find, hopefully, see this exact same program again. It is my hope that I can instill in you some sense of the Computer Science tradition which, if taught proiperly, always begins with "Hello, World!"

  1. Go into the CS labs (see this map for details) and log onto a Windows machine.
  2. Start up a new project, called HelloWorld, with a main class called Main.java. Refer to Lesson 2 if you are unsure how to do this. You do not need to include javabook2.jar in your class files. But be sure to delete TrivialApplication.java and set Main.java as the main file.
  3. In the blank file Main.java, write the following code:
  4. 
    public class Main {
    
    	public static void main(String[] args) {
    		System.out.println("Hello, World!");
    	}
    
    }
    
  5. Compile and run your program. A black console window should appear, and the words "Hello, World!" should be the first lines of it. You should also see the words "Press Enter to continue", signaling that the program has executed all of its lines of code and has stopped running.
  6. Press enter, as it says, and it the black console window will disappear.
  7. Congratulations! You have just written your first JAVA program! Feel free to brag to all your friends, relatives, and of course, your teacher.