By Jack G. Zheng, CIS@Georgia State University
Last updated 6/12/2006
Figure from Java Tutorial http://java.sun.com/docs/books/tutorial/getStarted/intro/definition.html
Figure from http://java.sun.com/j2se/1.5.0/docs/
J2EE 1.4 Container http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
/* CIS3270 Lecture Java Basics Code Example
* Description: the first and the most simple Java program
* Author: Jack G. Zheng
* Date: August 24, 2005
*/
class HelloWorld
{
public static void main(String[] args) //main method is the starting point of a program
{System.out.print("Hello, "); //console output
String s="World!"; //declaring a variable
System.out.print(s);}
}
static public void main(String[] args)
{System.out.print("Hello");
System.out.print(", World");
System.out.print("\nHello\n"); // \n means new line
System.out.println("Hello!"); //println prints a line followed by a line break
System.out.println(); //this prints an empty line
System.out.print("H\te\tl\tl\to"); // \t means tab}
}