A good answer might be:

Compiling Applets

As far as the compiler is concerned, the source file for an applet is just another object definition. It does not matter that the object is an applet. So the compiler works the same as it does with applications. To compile the above applet do this:

C:\> javac AnotherHello.java

This creates AnotherHello.class in your directory.

If you want, you can copy the above source code into NotePad, save it to AnotherHello.java, and compile it. You will not be able to run it in the usual way, however.


Why will...

C:\> java AnotherHello

...not run this applet?