还是引用老外的,我觉得讲得是对的,但java部分说null是null类型的一个特殊字面常量,我确实没法做确证工作,只有从事java语言开发者知道是否确实.c/c++可以从头文件上看到确如作者所说. 以下是引用内容:
这时讲讲什么是"literal ","literal"就是“字面上”,类似0这种直接写出来的数,"Hello"这样写出来的串,都叫字面常量。
Null in Java(tm)
In C and C++, "NULL" is a constant defined in a header file, with a value like:
0
or:
0L
or:
((void*)0)
depending on the compiler and memory model options. NULL is not, strictly speaking, part of C/C++ itself.
这时讲讲什么是"literal ","literal"就是“字面上”,类似0这种直接写出来的数,"Hello"这样写出来的串,都叫字面常量。