Recently again learned a bit, feel a lot of benefit, so here to write their own feelings for everyone and their own in the future time to learn.
Let's be clear, Java is a compiled language.
We compile Java source code into bytecode files, not compiled into machine language, and when we run this bytecode file under different operating systems, different operating systems
Java's virtual machine interprets the execution of this bytecode file. That's why Java is a cross-platform language.
Let me explain the Java operating environment.
The bottom layer of "Java HotSpot Runtime" that we see in the diagram is the core layer of Java, which is written in C + + and assembly language, why does Java cross the platform
Because this part can deal with different platforms. This layer is written in C + + and by sinks, and the rest of the layers (such as the JRE,JDK part) are in Java.
We also see that there is a layer of JRE, this is the Java public runtime, with this thing, our Java program can run. And then up we see the JDK, this Java development package
, including the compilation tools, development tools, debug tools. We see those rounded rectangles such as "text", "Util", which is the base library of Java.
and say it again. Java Basic data types
Data type length
Boolean 1
Char 16
BYTE 8 ( -127___128)
Short 16 ( -32767___32768)
int 32
Long 64
Float 32
Double 32
All numeric types in Java are signed, and there is no such unsigned type of number as Unint,unlong.
Data types in Java are uniform data types under any operating platform
For example, in Java, all int types are invariant in any operating system, and the type encoding of char in Java is Unicode and has a length of 16, which
What it means: If I use Java-written chat tools and chat with a person using the big code operating system, the chat language does not need to be converted by itself, and Java can transform itself.
Well, write it here today, and then come back to see you again next time.