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

This creates AnotherHello.class in your directory.

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


Why won't

C:/> java AnotherHello

work to run this applet?