•/* Sample
program to write "Hello World"
*/
•class HelloWorld {
• // No data declarations in
this class
• public static void main(String[] arguments) {
• System.out.println("Hello
World !");
• }
•}
Java programs (just as C and C++ programs) are
structured with nested blocks delimited by { and
}
For identifiers declared in a block, the same scope
rules
as those used in Pascal & Modula apply.