当前位置:网站首页>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
边栏推荐
- App optimization and advanced scoreboard Part 2 [Mui + flask + mongodb]
- W801/W800-wifi-socket开发(二)-UDP蓝牙控制wifi连接
- EBS:PO_EMPLOYEE_HIERARCHIES_ALL
- Error in face detection and signature of Tencent cloud interface
- After disk D is distributed to Disk C, what should I do if the database recovery hangs? Please answer
- Leetcode 112 Total path (2022.04.22)
- 关于C4D动画如何导入Lumion
- Rôles attributs personnels Abréviations
- 什么是bgp服务器,有哪些优势?
- 腾讯云接口进行人脸检测 和签名出错问题
猜你喜欢

What is an API interface?

Performance introduction of the first new version of cdr2022
![[经验教程]支付宝余额自动转入余额宝怎么设置关闭取消支付宝余额自动转入余额宝?](/img/d5/6aa14af59144b8c99aa6a367479f6b.png)
[经验教程]支付宝余额自动转入余额宝怎么设置关闭取消支付宝余额自动转入余额宝?

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

Shardingsphere broadcast table and binding table

What are the test steps of dynamic proxy IP?

How to "gracefully" measure system performance

How to classify proxy IP?

浅析一下隧道代理IP的优缺点。

批处理多个文件合成一个HEX
随机推荐
搭建个人主页保姆级教程(二)
Use yolov4 on colab
.NET单元测试第一篇:常见.NET单元测试框架有哪些?
如何对代理IP进行分类?
在使用代理IP前需要了解哪些分类?
浅析一下隧道代理IP的优缺点。
Rôles attributs personnels Abréviations
EBS:PO_EMPLOYEE_HIERARCHIES_ALL
English abbreviation of role personal attribute
W801/W800-wifi-socket开发(一)-UDP
2022.4.10-----leetcode.804
The leader / teacher asks to fill in the EXCEL form document. How to edit the word / Excel file on the mobile phone and fill in the Excel / word electronic document?
Question bank and online simulation examination for safety management personnel of hazardous chemical business units in 2022
Batch multiple files into one hex
[leetcode daily question] 396 Rotation function
最长公共子序列(记录路径版)
npm——配置淘宝镜像
Leetcode 112 Total path (2022.04.22)
How to classify proxy IP?
Ziguang micro financial report is outstanding. What does the triple digit growth of net profit in 2021 depend on