Java Reference
In-Depth Information
19
Figure 11
Running the
HelloPrinter
Program in an Integrated Development
Environment
The construction
public static void main(String[] args)
{
}
defines a method called
main
. A method contains a collection of programming
instructions that describe how to carry out a particular task. Every Java application
must have a
main
method. Most Java programs contain other methods besides
main
,
and you will see in
Chapter 3
how to write other methods.