| Hello World Application in Java David Matuszek |
Here is everybody's favorite program in Java:
public class Hello {
public static void main (String args[]) {
System.out.println ("Hello, World!");
}
}
|
To run this program,
Hello.java. Do
not give the file some other name. javac Hello.javaHello.class java HelloNotes
Hello,
then it must be in a file named Hello.java. If your operating system
has case-sensitive file names, the first part of the file name (Hello in this
case) must be capitalized the same way as in your program. javac requires the name of the file (as you would
expect), that is, Hello.java. java interpreter that wants the name of
the class only, with no .class extension--given the class name, it can
figure out the file name.