The main features of the Java language

Source: Internet
Author: User

The main features of the Java language:

1. Cross-platform

The so-called cross-platform, the software can be free from the computer hardware and operating system constraints and in any computer environment, normal operation. This is the trend of software development and the goal that programmers pursue. The reason for this is that because of the variety of computer hardware, operating systems are different, users and companies have their own different computer environment preferences, and software in order to be able to operate in these different environments, it needs to be independent of these platforms.

In the Java language, Java-brought virtual machines are a good way to achieve cross-platform. Java source code compiled after the generation of binary bytecode is platform-independent, but can be recognized by the Java Virtual Machine code instructions. Java virtual machines provide a barrier to the underlying hardware platform and operating system, making the Java language cross-platform.

2, Object-oriented


Polymorphism is a variety of forms, specifically, you can use "an external interface, a number of internal implementation methods," said. For example, a stack in a computer can store data in a variety of formats, including integer, floating-point, or character. The algorithm implementation of the stack is the same regardless of what data is stored. For different data types, programmers do not have to choose manually, only using the uniform Interface name, the system can be automatically selected. Operator overloading (operatoroverload) has been considered an excellent polymorphic mechanism, but since it makes the program difficult to understand, Java finally cancels it.

Inheritance refers to an object that uses properties and methods of another object directly. In fact, many of the entities we encounter have the meaning of inheritance. For example, if you think of a car as an entity, it can be divided into sub-entities, such as trucks, buses, and so on. These sub-entities have the characteristics of cars, so cars are their "fathers", and these sub-entities are "children" of cars. Java provides the user with a series of classes (Class), Java classes have hierarchies, subclasses can inherit the properties and methods of the parent class. Unlike some other object-oriented programming languages, Java only supports single inheritance.

3. Security
Security can be divided into four levels, namely, language-level security, compile-time security, run-time security, executable code security. Language-level security refers to the data structure of Java as a complete object, which has security over the encapsulated type Compile-time Java language and semantic checks to ensure that each variable corresponds to a corresponding value, compiled after the Java class. The runtime Java class requires the ClassLoader to be loaded and verified by the bytecode checker before it can run. When a Java class is used on a network, its permissions are set to ensure the security of the user being accessed.

Most Java (TM) programs running on ISeries servers are applications, not applets, so the sandbox security model does not restrict them. From a security standpoint, Java applications are subject to the same security restrictions as any other program on the iSeries server. To run a Java program on a iSeries server, you must have permissions on the class file in the integrated file system. Once the program is started, it runs under the user Rights control. You can use inherited permissions to access objects that have the permissions of the user who runs the program and the permissions of the program owner. The inherited permission temporarily grants the user permission to the object that the user originally did not have access to.

4. Multithreading
Multithreading has been the most successful application in the operating system. Multithreading refers to allowing an application to have two or more threads at the same time to support transactional concurrency and multi-tasking. In addition to the built-in multithreading technology, Java defines classes, methods, and so on to establish and manage user-defined multithreading.

5, concurrency : Java support multithreading Technology, is a multi-thread parallel mechanism, multithreading is an important method of Java, especially for the implementation of concurrent tasks in the program. Java provides thread threading class, which implements the concurrency mechanism of multithreading. However, the concurrent execution of the program must have multiple threads mutually exclusive access critical resources, so the key to solve the concurrency system is to manage and allocate critical resources, and in the critical resource allocation there are two aspects to be considered, That is, security and fairness. In this paper, the security and fairness of multi-threaded concurrency system is discussed firstly, and the importance of security and fairness in accessing critical resources in concurrent systems is pointed out. And through the example of a single-line tunnel in a train, the driving conditions under various conditions are demonstrated to further illustrate the problem.

6, dynamic memory management mechanism
The Java language uses an automatic garbage collection mechanism for memory management. In the C + + language, programmers need to carefully handle the use of memory when writing programs, such as when a memory is quickly used, to be released in time for other programs to use, once memory management is improper, it is possible to cause memory space waste or program operation failure. <BR> includes an automated garbage collection program in the Java system that automatically and securely reclaims blocks of memory that are no longer in use, so programmers can program without worrying about memory management, making Java programs easier to write, and reducing the likelihood of errors in memory management.

7. Easy to use
Java source code is written in a specific environment, you can use Notepad, text editor and other editing software to implement, and then compile the source files, compiled through the direct operation, through debugging can get the desired results.

8. Application and Application applet:

Java applications and Java Appletjava languages are object-oriented programming languages that, using the Java language, can write two classes of programs: Java Applications (application) and Java App1et (applets):
Java applications are written in the Java language and, after compilation and interpretation, can be run independently on operational platforms such as Ms-dos,unix. Java applications typically run on a command-line basis.

Java applets cannot be run independently, App1et must be embedded in an HTML file and need to be started by the browser to run. In this way, the specified applet is automatically downloaded to run in the user's browser, resulting in special page effects such as animations, sounds, charts, images, and so on. By embedding applets in a Web page, you can enable dynamic interaction between Web pages and users, such as receiving input from a user, and then generating different responses based on the needs of the user.
In the case of Java applets, it is embedded in HTML files, the content of the HTML file is mostly text, pictures, tables, sounds, etc., but these things are generally static, two-dimensional. However, when an applet is embedded in an HTML file, the entire page exhibits diversity and variability, such as interactivity, graphs, and so on. The difference between the Java language and the HTML language in terms of usage is:

(1) The HTML language belongs to a simple markup language, and the average user can learn how to write HTML files in a few hours. The Java language structure and writing method is more similar to C + +, so learning Java language to have the basic design and object-oriented concept.

(2) The Web page is written mainly in HTML language, but if you want to make the page more changeable, diverse, interactive, you can use the Java language to achieve this effect, play a icing on the cake.

Embedding applet</font> <br>applet in HTML files is an important application of Java in the WWW of the Internet, and its advent has also prompted Java to become an increasingly popular programming language. Applets are small programs written in the Java language that are embedded in a Web page and executed by the browser to produce special page effects. Web pages embedded with applets look more colorful and have dynamic interactivity capabilities.

With a lot of app1et on the Internet, these applets are mostly designed by Java developers such as Sun, and for the vast majority of users, especially beginners, can download these app1et to their computers, Well, by embedding these downloaded app1et into their web pages, they get their own web pages with the same effect to enrich their page content.

  

The main features of the Java language

Related Article

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.