Exercise I - Hello World (& BlueJ)

Description:

Objectives:

  1. Learn the process to start a new programming project
  2. Learn to use BlueJ to enter the "code" for a program
  3. Use BlueJ to run the program
  4. See the basic elements of a Java program - especially some common "syntax" elements such as:
  5. See how a syntax error (typo/bad grammar) is shown in BlueJ.

The Exercise:

Questions, Experiments, & Reflection:

  1. Now modify your program so it says "Hello" followed by your name.
  2. What are the curly braces ({}) used for in a Java program.
  3. Java programs contain "statements". A statement just states something that the computer should do. Explain what the statement "System.out.println("Hello World!") does.
  4. Make it print a second line that says "Goodbye" followed by your name. (Hint: Copy and paste a second System.out.println(...) in.)
  5. Change the two println to just print (i.e. remove the ln). What happens when you run it? What do you think the ln stands for?