Start of Tutorial > Start of Trail |
Search
Feedback Form |
Now that you've seen the "Hello World" application (and perhaps even compiled and run it), you might be wondering how it works. Here, again, is its code:/** * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } }
The "Hello World" application contains two comments. The first comment, at the top of the program, uses/**
and*/
delimiters. Later, a line of code is explained with a comment that's marked by//
characters. The Java programming language also supports the familiar C-style comment, which is delimited with/*
and*/
.
Like most object oriented languages, the fundamental building block in the Java programming language is the class. This section introduces you to classes, and discusses the class definition of the "Hello World" application.
main
Method
The entry point of every application is itsmain
method. This section discusses the requirements for this method, and shows howmain
is implemented in the "Hello World" application.
This section describes the ways in which the "Hello World" application uses classes and objects.
Start of Tutorial > Start of Trail |
Search
Feedback Form |
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.