In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to use the Java virtual machine". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use the Java virtual machine.
Java virtual machine
Java virtual machine (JavaVirtualMachine) referred to as JVMJava virtual machine is an imaginary machine, which is realized by software simulation on the actual computer. The Java virtual machine has its own imaginary hardware, such as processors, stacks, registers, etc., as well as corresponding instruction systems.
What is a Java virtual machine
Java virtual machine (JavaVirtualMachine referred to as JVM) is an abstract computer running all Java programs. It is the running environment of Java language. It is one of the attractive features of Java***.
Characteristics of Java virtual machine
A very important feature of Java language is its platform independence. The use of Java virtual machine is the key to realize this feature. If a general high-level language is to run on different platforms, it needs to at least be compiled into different object code. After introducing the Java language virtual machine, the Java language does not need to be recompiled when it runs on different platforms. The Java language uses the pattern Java virtual machine to shield the information related to the specific platform, so that the Java language compiler only needs to generate the object code (bytecode) running on the Java virtual machine and can run on a variety of platforms without modification. When executing the bytecode, the Java virtual machine interprets the bytecode as the execution of machine instructions on the specific platform. Idobelieve
The main body of the Java virtual machine
The Java virtual machine is the basis of the underlying implementation of the Java language, and anyone interested in the Java language should have a general understanding of the Java virtual machine. This helps to understand some of the nature of the Java language, as well as to use the Java language. For the software personnel who want to implement the Java virtual machine on a specific platform, the compiler writers of the Java language and those who want to implement the Java virtual machine with hardware chips, they must have a deep understanding of the specification of the Java virtual machine. In addition, if you want to extend the Java language, or compile other languages into Java bytecode, you also need to learn more about the Java virtual machine.
Data types supported by Java virtual Machin
The basic data types that the ◆ Java virtual machine supports the Java language are as follows:
Byte://1 byte signed integer complement short://2 byte signed integer complement int://4 byte signed integer complement long://8 byte signed integer complement float://4 byte IEEE754 single precision floating point double://8 byte IEEE754 double precision floating point char://2 byte unsigned Unicode character
Almost all Java type checking is done at compile time. The data of the raw data types listed above does not need to be marked with hardware when executed by Java. The bytecode (instruction) that manipulates these raw data types already indicates the data types of the operands, such as the iadd, ladd, fadd, and dadd instructions, which add two numbers, and the operands are int, long, float, and double. The virtual machine does not set separate instructions for the boolean (Boolean) type.
Boolean data is processed by integer instructions, including integer returns. Boolean arrays are processed with byte arrays. The virtual machine uses floating-point numbers in IEEE754 format. Older computers that do not support the IEEE format may be very slow when running the Java numerical calculation program.
Other data types supported by the ◆ Java virtual machine include:
Object// references returnAddress//4 bytes to the 4 bytes of a Javaobject (object) for use in jsr/ret/jsr-w/ret-w instructions
Note: Java arrays are treated as object.
The specification of virtual machines does not have any special requirements for the internal structure of object. In Sun's implementation, a reference to object is a handle that contains a pair of pointers: one pointer to the object's method table and the other to the object's data. Programs represented by the bytecode of the Java virtual machine should comply with the type rules.
The implementation of the Java virtual machine should refuse to execute bytecode programs that violate the type specification. The Java virtual machine seems to run only on machines in 32-bit address space due to bytecode definition limitations. But you can create a Java virtual machine that automatically converts bytecode into 64-bit form. From the data types supported by the Java virtual machine, we can see that Java strictly regulates the internal format of the data type, which makes the interpretation of the data in the implementation of various Java virtual machines the same, thus ensuring the platform independence and portability of Java.
Thank you for reading, the above is the content of "how to use the Java virtual machine". After the study of this article, I believe you have a deeper understanding of how to use the Java virtual machine, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.