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
AnotherHello.class in your directory.
If you want, you can copy the above source code into an editor, save it to
AnotherHello.java, and compile it.
You will not be able to run it in the usual way, however.
C:/> java AnotherHello
work to run this applet?