java - NullPointerException should be called NullReferenceException? -


we don't talk pointers in java, why use term nullpointerexception in java? think exception name nullreferenceexception makes more sense.

we talk null pointer exceptions because exception named nullpointerexception. why? never know sure ... unless original design team explains history1.

the fact there inconsistency doesn't matter. know meant. interesting note javadoc nullpointerexception sidesteps issue talking null without using words "pointer" or "reference".

and before suggest java team should change name of exception, consider impact have.


1 - theory on (in pre-java 1.0 days) pointer , reference used interchangeably. decided use "java has references not pointers" point of difference c , c++ ... left core exception had anomalous name.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -