Basic HTML version of Foils prepared September 1 99

Foil 9 The Simplest Java Application: Hello,World!

From Introduction to Java Language and Applets CPS406/606 Fall Semester 1999 -- September 2 99. by Nancy J. McCracken, Geoffrey C. Fox

The HelloWorld Application for Foil 9
1 Since Java is object-oriented, programs are organized into modules called classes, which may have data in variables and subroutines called methods.
2 class HelloWorld
3 { public static void main (String[] args)
4 { System.out.println("Hello World!");
5 }
6 }
7 Each program is enclosed in a class definition.
8 main() is the first method that is run.
9 The notation class.method or package.class.method is how to refer to a public method (with some exceptions).
10 Syntax is similar to C - braces for blocks, semicolon after each statement. One difference: upper and lower case matter!

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Sep 1 1999