This article describes the differences between java application and java applet.
Java is a semi-compiled and semi-interpreted language. Java User Programs are divided into two types: Java Application and Java Applet. These two types of programs have some differences in the composition structure and execution mechanism, mainly reflected in the following aspects:
1. The running mode is different. Java Application is a complete program that can run independently. Java Applet cannot run independently. It must be embedded into a Web page written in HTML, control execution through a Java-compatible browser.
2. Different running tools. After the Java Application program is compiled, it can be interpreted and executed with a common Java interpreter. Java Applet can only be executed through a Web browser or Applet observer.
3. The program structure is different. Each Java Application must contain one and only one main method. When executing a program, you must first find the main method and run it as the entry point. The class that contains the main method is often called the main class, that is, the Java Application program contains a main class. The Applet does not have the main class containing the main method, which is exactly why the Applet cannot run independently. Although the Applet does not have a main class containing the main method, the Applet must have a class derived from java. applet. Applet, which is provided by the Java system.
4. Different Java Application programs can be designed to perform various operations, including reading/writing file operations. However, Java Applet cannot read the disk files on the site, or write operations. However, due to the introduction of Applet, Web pages have dynamic multimedia effects and interactive performance, this enables a Web page written in HTML language named Hypertext and plain text to have the hypertext function, which not only displays text information, in addition, it can have a variety of image effects and dynamic graphics effects to make the page appear vivid and beautiful. In addition, the Applet adds buttons and other functions to the Web page, thus increasing interaction.