1:system is a final decorated class that cannot be inherited and can be called
2:system class has a native decorated method, native decorated method means that the method is not implemented locally, but in other languages to write programs to operate the operating system, the Java language can not operate on the operating system, so it is possible to use this way to program in C language, Implement the operation of the operating system, and then compile it into a dynamic library on the line. Java is a JNI that allows Java to use functions written in other languages (JNI is Java Native Interface Java Native interface)
The following are the steps to write JNI:
A. Writing a Java class with a native declaration method
B. Compiling a Java class using the Javac command
C. Use JAVA-JNI * * * * to generate a header file with a suffix of. h
D. Implementing local methods using other languages (c, C + +)
E. Generating a dynamic-link library of files written by local methods
The system class is one such example
Many static stream objects are defined in the 3:system class: Eg InputStream in, printstream out, PrintStream err
There is also a volative-modified property in the 4:system class:
private static volatile SecurityManager security = null;
Volatile
With volatile modifiers, the thread will read the variable's most-modified value each time it uses the variable. Volatile is easily misused and used for atomic operations.
Volatile-modified variables can only guarantee that the value that each thread obtains from memory must be up-to-date, but there is still a thread concurrency problem, because after the thread obtains the value from memory, the action on that variable is done after creating a copy of the variable, that is, manipulating the variable copy. Then when the thread is about to be rolled out, the value is then written back into memory, but it is possible for other threads to manipulate the variable during the operation. Therefore, there is a thread concurrency problem. Automatically writes the value back to memory after the thread executes, as if it were a lastprivage-decorated thread in multicore. The thread initializes a copy of the object with memory and then operates on the copy as if it were a copyin-decorated thread in multicore, and this object of the thread is the private variable of the thread
JDK Learning Path----System