Basic HTML version of Foils prepared Oct 1 98

Foil 7 The Simplest Java Application: Hello,World!

From Java Tutorial 98- 1: Introduction to Java Language and Applets CPS606 -- Fall Semester. by Geoffrey C. Fox, Nancy McCracken

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



© 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 Sat Nov 28 1998