Ten minute quick understanding of java knowledge point system class

A question I met in the last interview asked system out. At that time, I asked if out in println () was an internal class. I intuitively felt that out should be an attribute of the system class. What is the relationship with the internal class? In addition, when sorting out the IO part, I remember that there is a printstream class for standard output, but I have never seen the source code of system and dare not say it casually. Later, I looked at the source code and found that it was indeed printstream. Maybe I wanted to ask about the usage of internal classes at that time, but in the final analysis, my level is much worse, so I still have to study it carefully. To get down to business, system class is a tool class provided by JDK. It is decorated with final and cannot be inherited. It can be seen from the name. Most of its operations are related to the system. Its main functions are as follows:

Look directly at the figure below. The main methods and functions have been listed.

The static code block in the class calls a native method registernatives (). You can guess that this method should be an entry method. Take a look at the notes: register the native method through static initialization, which will enable VM to complete initialization by calling initializesystemclass method. If so, let's take a look at the initializesystemclass method:

So far, the system is basically finished. I hope the description in this article will be helpful to your study.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>