Difference between an application and an applet

May 20, 2009, Posted by admin at 8:25 am

This question can be answered on many levels. Technically an application is a Java class that has a main method. An applet is a Java class which extends java.applet.Applet. A class which extends java.applet.Applet and also has a main method is both an application and an applet.

More generally and less technically an application is a stand-alone program, normally launched from the command line, and which has more or less unrestricted access to the host system. An applet is a program which is run in the context of an applet viewer or web browser, and which has strictly limited access to the host system. For instance an applet can normally not read or write files on the host system whereas an application normally can.

The actions of both applets and applications, however, can be controlled by SecurityManager objects. If you can change the SecurityManager that’s used you can change what an applet or an application is and is not allowed to do. Thus these are not hard and fast differences, though this is normally how they separate out in practice.

No comment yet.

You must be logged in to post a comment.