Are there pointers in Java? The short answer is “no, there are none” and this seems to be obvious for many developers. But why is it not that obvious for others?
That is because the references that Java uses to access objects are very similar to pointers. If you have experience with C programming before Java it may be easier to think about the values that are stored in the variables as pointers that point to some memory locations holding the objects. And it is more or less ok. More less than more but that is what we will look at now.
Difference between reference and pointer
- There is no pointer arithmetic
- References do not “point” to a memory location
Missing pointer arithmetic
When you have an array of a struct in C the memory allocated…
View original post 1,179 more words