3 ms·
That is just a name, decided before Java settled on a consistent terminology. In C# it is NullReferenceException. We get into nitpicking, but I would argue ref
by olavk 10y ago
That is just a name, decided before Java settled on a consistent terminology. In C# it is NullReferenceException.
We get into nitpicking, but I would argue references and pointers are not the same. Pointer are by definition memory addresses, while references are opaque and could be addresses under the hood.
Note also that C# does have pointers, but they are separate from references.
- vbezhenar 10y agoWell, memory address is a memory address and pointer is a pointer. You can have virtual function pointer in C++, which is much more than just a memory address, it's a complex value, yet it's called a function pointer. If you're using that definition then yes, but I don't think that everyone uses it. For me pointer is an entity which points to some value, the key is an indirection, not an implementation. I think, that even C++ would allow compiler to implement pointers as something opaque (e.g. for safety).