Why does Java have NullPointerException instead of NullReferenceException? [duplicate]

老子叫甜甜 提交于 2019-11-30 17:36:46

The statement that Java "officially has no pointers" is simply false. Just because you can't do arithmetic on it doesn't mean it's not a pointer. C is not the final authority for programming terminology.

The only people who get hung up over it are either C/C++ fans who want to disparage Java for its lack of power over the bare metal, or (unlikely, nowadays) marketing people who want to sell Java as a simpler, safer alternative to managers who've had bad experiences with C development.

From the Java language specification:

The reference values (often just references) are pointers to these objects, and a special null reference, which refers to no object.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!