Differences between java application and java applet

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.