Java Programs  «Prev  Next»
Lesson 3Understanding applications and applets
ObjectiveDescribe the differences between Java applications and applets.

Understanding Applications and Applets

Applications and Applets
Java programs are broken down into two fundamental types:
  1. applets and
  2. applications.
As you may already know, applets are graphical programs that run within the context of a Web page. You have probably seen applets while surfing the Web.
Java applications are different from applets because they can be graphical or command-line. Applications do not require a Web browser and run entirely on their own. Command-line Java applications are ideal for creating simple utilities due to their minimal overhead. Graphical Java applications typically are larger in scope.
Graphical Java applications are like applets in many ways except for the fact that they are responsible for creating and managing their own frame window (a Web page serves as the frame window for an applet). Java applications (like Java applets) are created as classes but are executed using the Java interpreter[1] instead of a Web browser or the AppletViewer[2].

Security Distinction

Security plays the biggest role in distinguishing applets and applications. Applets are Web-based, which means that they could potentially cause lots of trouble on a computer with little warning. For this reason, they have [2]s.
Applications are manually installed by the user and are therefore considered secure by default, which means that they have little or no security limitations. The differing levels of security between applets and applications frequently result in limitations on what applets can functionally accomplish.
As an example, you could develop an application that searched the local hard drive for information, while an applet could not accomplish this task under normal circumstances due to its security limitations.

Application Applets - Quiz

Click the Quiz link below to check your knowledge of applications, applets, and the Java API.
Application Applets - Quiz

[1] Java interpreter: The Java interpreter is a program responsible for translating Java bytecode into native code that can execute on a given platform.
[2] AppletViewer: AppletViewer is a utility included with the Java Development Kit that allows you to test applets without using a Web browser.