3 ms·
It is wikipedia[1] definition of pointer. > In computer science, a pointer is a programming language object, whose value refers to (or "points to") another val
by yetihehe 10y ago
It is wikipedia[1] definition of pointer.
> In computer science, a pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address.
> [2] Pointers are the most primitive. Due to their intimate relationship with the underlying hardware, they are one of the most powerful and efficient types of references.
Pointer "points to memory", so if you change value of a pointer, you change what memory it points to. In java you can't change what a pointer points to. It's only references.
> I'm actively using pointers that point to object.
No, you passively use references that point to object. You can't do *(ptr+1) in java.
Leaky abstraction means that it's called a pointer but it isn't a real pointer. Also as another commenter said, in C# it's properly called a reference.
[1] https://en.wikipedia.org/wiki/Pointer_(computer_programming) https://en.wikipedia.org/wiki/Pointer_(computer_programming)
[2] https://en.wikipedia.org/wiki/Reference_(computer_science)#Examples https://en.wikipedia.org/wiki/Reference_(computer_science)#E...
- vbezhenar 10y agoOf course you can change the value of pointer in Java, just assign any other address. Even if I can't do pointer arithmetic in Java, they are still pointers, just without pointer arithmetic.