Class 1, Part 2 Intro to Java 30-IT-396  

Your First Java Program: Practice with the Bare Bones

// Define the class.  No package for this simple application.
public class HelloWorld {

 // The public static void main method for running from a command line
 // String args[] is a String array that contains the command line arguments.
 public static void main(String args[]) {

  // Define a variable called message, put some default text in it.
  String message = "Hello world, this is Java I!";
 
  // Print that to the output window
  System.out.println(message);

 // Close the method.
 }

// Close the class.
}
 


A closer look

Created by:  Brandan Jones December 17, 2001
Updated September 28, 2004