Submitted by GeePee on Thursday, June 11, 2015 - 22:50.
Welcome! This page will talk about the difference between Java Applets and Java Applications.
What is the difference between Java Applets and Java Applications?
Both Java Applets and Java Applications are ran from the same Java source code, the only different is how it is ran. A Java Application must have the resource files stored locally (in other words, it must be ran directly on a device), it must contain a "main()" method and is compiled by using the "javac" (Java Compiler) on the development system, this is done through Command Prompt (CMD) manually or within the IDE used to develop the application. Java Applets on the other hand, do not require a "main()" method to initiate the process, they must be contained within a website document (HTML, PHP, etc.), they are stored on the server of a website or FTP server (or other online source) and they are also compiled using the Java Compiler but they are unable to run standalone.
When are they used?
Java Applications are used for anything Java program which is downloaded and ran locally, whereas Java Applets are used mainly for online purposes, such as online 3D viewers, or online 3D (embedded) games (Minecraft Classic, for example).
It has been clearly noted within the Java updates (and on Applet confirmation screens) that there is a massive security problem with allows online applets to be ran. This is because the applet can be used to infect your computer by accessing your PC through the allowed Java plug-in. Because of this security problem, Oracle (The creators of Java) have stated that they are removing the ability to run Java Applets in the near future.