当前位置:网站首页>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最新中文版本安装下载图文教程
- [leetcode daily question] 396 Rotation function
- W801 / w800 WiFi socket development (I) - UDP
- 2022.4.22-----leetcode.396
- 2022 Saison 6 perfect Kid Model IPA national race Leading the Meta - Universe Track
- About how to import C4d animation into lumion
- [经验教程]支付宝余额自动转入余额宝怎么设置关闭取消支付宝余额自动转入余额宝?
- ESP32蓝牙Bluetooth Controller API介绍
- Problem solving: dpkg DEB: error: package name has characters that are't lowercase alphanums or '- +‘
- NPM yarn startup error [resolved]
猜你喜欢

FL studio20.8最新中文版本安装下载图文教程

Shardingsphere broadcast table and binding table

JSP基础知识总结

W801/W800/W806唯一ID/CPUID/FLASHID

W801 / w800 WiFi socket development (I) - UDP

代理IP可用率是不是等同于代理IP的效率?

What categories do you need to know before using proxy IP?

搭建网站是用物理机还是云主机好?

J-Link RTT使用

Is it better to use a physical machine or a virtual machine to build a website?
随机推荐
What problems will you encounter when dialing VPS?
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?
PID refinement
搭建个人主页保姆级教程(二)
2022.4.22-----leetcode. three hundred and ninety-six
Under the pressure of sales, domestic mobile phones began to reduce prices, but they haven't put down their final face
What is a dial-up server and what is its use?
批处理多个文件合成一个HEX
Digital collection platform settled in digital collection platform to develop SaaS platform of digital collection
[经验教程]支付宝余额自动转入余额宝怎么设置关闭取消支付宝余额自动转入余额宝?
When should I write unit tests? What is TDD?
English abbreviation of role personal attribute
What are the test steps of dynamic proxy IP?
配置iptables实现本地端口转发的方法详解
腾讯云接口进行人脸检测 和签名出错问题
J-Link RTT使用
PID精讲
JSP basic knowledge summary
Introduction to esp32 Bluetooth controller API
K zeros after leetcode factorial function