4 ms·
It has references, but from what I understand they don't entirely conceptually match in use, implementation, and semantics to C++ references.
by w7 3y ago
It has references, but from what I understand they don't entirely conceptually match in use, implementation, and semantics to C++ references.
- kaba0 3y agoIt has pointers aliased as references. They are pointers for all practical purposes. NullPointerException is named as such for this very reason - pointers were considered scary back then, hence the marketing term.
- w7 3y agoYes, implementation wise underneath in most cases they're likely some structs/pointers/whatever, but the point was that interaction with them from the perspective of an application running on the JVM is not the same as what the JVM sees itself, nor are the same exact operations available-- you'd have to create abstractions or use implementation specific jdk.internal.misc.* calls, and at that point why are you using the JVM.