当前位置:网站首页>Today will finally write system out. Println()
Today will finally write system out. Println()
2022-04-23 01:55:00 【Sivan_ Xin】
List of articles
I've been sorting out IO When streaming notes , We found such a problem ······
understand System.out.println()
stay Java.lang There is a System class , It defines a class ( static state ) Member variables :
public final static PrintStream out = null;
thus it can be seen ,out nothing but PrintStream An object of . because out stay System Class is statically decorated , So you can call... Directly through the class name System.out.(System.in It's the same thing , I won't go into details here .)
Now? , We got PrintStream An object of class System.out, Calling methods through objects (println) It's better to understand , So you get this statement System.out.println.
// Generally, no one will write like this , It's just easy to understand .
PrintStream Myout = System.out;
Myout.println("Sivan");
Null pointer out
here out As an object but declared as null. But why not throw NullPointerException?
Because in System Class has a static initialization block :
/* register the natives via the static initializer. * * VM will invoke the initializeSystemClass method to complete * the initialization for this class separated from clinit. * Note that to use properties set by the VM, see the constraints * described in the initializeSystemClass method. */
private static native void registerNatives();
static {
registerNatives();
}
JVM When loading a class , It is through registerNatives() This static method gives out Given the initial value , As for the specific operation , You can refer to this article :https://zhidao.baidu.com/question/38660871.html.
thus it can be seen ,Java All things are objects .
The most important thing is coming ~~~
It's not easy to code words , Ask for attention
Order a collection and don't get lost ~
版权声明
本文为[Sivan_ Xin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230154527475.html
边栏推荐
猜你喜欢

FL studio20. 8 the latest Chinese version installation and download graphic tutorial

42、使用mmrotate中k3det进行旋转目标检测,并进行mnn部署和ncnn部署

有哪些常见的代理ip问题?

The sixth season of 2022, the perfect children's model IPA national race leads the yuanuniverse track

Introduction to esp32 Bluetooth controller API

What is an API interface?

使用代理IP是需要注意什么?

Challenges often faced by client project management

Server 2019 the available memory of the server is half of the actual memory

动态代理ip的测试步骤有哪些?
随机推荐
How can e-procurement become a value-added function in the supply chain?
Introduction to micro build low code zero Foundation (lesson 2)
2022第六季完美童模 IPA国民赛领跑元宇宙赛道
Analyze the three functions of static proxy IP.
教程】如何用GCC“零汇编”白嫖MDK
Use of j-link RTT
Tight coupling of visual wheel odometer
Shardingsphere sub database and sub table
Problem solving: dpkg DEB: error: package name has characters that are't lowercase alphanums or '- +‘
浅析静态代理ip的三大作用。
Use yolov4 on colab
什么是api接口?
Digital collection platform settled in digital collection platform to develop SaaS platform of digital collection
PHP & laravel & master several ways of generating token by API and some precautions (PIT)
FL studio20.8最新中文版本安装下载图文教程
拨号服务器是什么,有什么用处?
Is the availability of proxy IP equal to the efficiency of proxy IP?
在使用代理IP前需要了解哪些分类?
有哪些常见的代理ip问题?
如何“优雅”的测量系统性能