Java and Java virtual machines

xiaoxiao2021-03-05  28

The concept of virtual machines introduced in Java, that is, a layer of abstract virtual machine is added between the machine and compiler. This virtual machine is provided to a common interface for the compiler on any platform. Compile programs only need to facilitate virtual machines, generate code that virtual machines can understand, and then convert virtual machine code to machine code execution by the interpreter. In Java, this code for virtual machine understanding is called bytecode, which is not facing any particular processor, for virtual machines. The interpreter of each platform is different, but the realized virtual machine is the same. The Java source program is compiled by the compiler that turns into bytecode, and the byte code is performed by the virtual machine. The virtual machine gives each byte code to be executed to the interpreter, the interpreter translates it into a machine on a particular machine. Code, then run on a specific machine. It can be said that the Java virtual machine is the foundation of the Java language. It is an important part of Java technology. The Java virtual machine is an abstract computer, like actual computers, which has an instruction set and uses a different storage area. It is responsible for executing instructions and manages data, memory, and registers. The Java interpreter is responsible for translating the byte code into a machine code for a specific machine. Java is a simple language. It uses not much concept, and is more familiar to programmers. If you are a programmer, master Java is a thing that is easy for you. Even if you have not learned any programming language, learn Java is more easier than learning C . Since Java is originally designed to control electronics, it must be simple. In order to ensure this simplicity, Java removes many of the complex, redundant, unity concepts in C , such as operator overload, multi-inheritance, data type automatic conversion, etc. In order to dissolve the programmer from the burden of complex memory management, Java uses the automatic memory garbage collection mechanism, and the programmer does not need to release, but by Java itself. Collect, release the useless blocks in the memory. Compared with C , Java has a stronger object-oriented property, which is a relatively purely object-oriented language. Generally, some so-called object-oriented programming languages, such as C , Object Pascal, etc., are actually a hybrid language, that is, in process-oriented language, an object-oriented extension. In Java, almost everything is object, even some basic data types, such as integer, character type, floating point, etc., can be treated as object processing in Java. Object-oriented properties of Java can be comparable to SmallTalk, but their features for distributed computing environments are far more than SmallTalk. Java is a programming language that supports distributed operations. Using the URL class provided by Java, users can access objects on the network like accessing the local file, which is very convenient to use. In the client / server mode, Java can also disperse the operation from the server to the client, improve the efficiency of the system, and avoid the bottleneck constraints of the server. Java's network class library supports distributed programming. The Socket class provides a reliable streamline connection to support TCP / IP protocol. By writing protocol handle, programmers can expand Java supported protocol collections. Java provides very effective security control. Since Java is applied to the development of the network program, it is critical to the security. Because the Java applet needs to download to the client interpretation, if there is no security control, some online hackers will be a machine, which is very dangerous to the user. Fortunately, Java's security mechanism can effectively prevent the production of virus programs, download procedures for the damage of local file systems, and network hackers steal password and invasion. Java is a very robust language.

Because the following means is used in Java: the pointer is not supported. In a C program, the pointer's error uses the fierce of BUG in the usual program. The pointer is completely removed in Java to eliminate illegal access to memory, thus ensuring the reliability of the program. Strong type language. Automatically store garbage collection mechanism. Java automatically collects useless memory cells to prevent dynamic memory allocation issues caused by memory leakage. A perfect exception handling mechanism has simplified error handling tasks and recovery, and also adds the readability of the program. Java has a very good platform independent and portability. Because Java is originally designed for electronic product programming, it has a perfect platform innocence. It uses a code-independent code-byte code, rather than the machine code on a normal machine, interpreted by the Java interpreter in the Java virtual machine on the platform. The Java virtual machine is free and there are many platforms. Java offers good portability. Using Java as a programming language, as long as program development work, the developed program does not need to be running on a variety of platforms. Java uses two ways to make Java applications do not rely on specific systems: adopting international standard-based data types. Java's raw data type is the same on any machine, such as 32 digits, and a long integer is always 64 bits. Original: http://www.matrix.org.cn/Article/20.html

转载请注明原文地址:https://www.9cbs.com/read-35244.html

New Post(0)