//HelloWorld.java // slash slash is start of "comment" to end of line. //comments are skipped/ignored by compiler. they're for people, //help us understand the program. //can have one "public" "class" in a file. //filename must be same as the public class. //you choose name of the class. //names can only have letters and digits and must start with letter. //public means it's accessible/usable by other classes. //Java program's code is organized into classes //(but in this course, all our programs will be one class only, // so the public class is the complete program.) //public, class, static (the blue words in JCreator) are part of the //builtin vocabulary ("reserved words"/"keywords") of Java. public class HelloWorld { //required braces are used to indicate beginning and end of container. //application has a main "method". it's where program begins. //method is a named bunch of code. //a class could have other methods // (but in this course, our applications will have main only). public static void main (String[] args) //must be this incantation { //output to DOS box by System.out.println method System.out.println ("Hello World!"); //double quoted is a "string" (sequence of characters/text). //here it's the "parameter"/"argument" given/passed to the method. //semicolon indicates end of a statement. //every statement must be terminated with a ; } //notice the indentation. each level is 4 spaces. //try to keep each line less than 80 chars wide. }