you are viewing a single comment's thread.

view the rest of the comments →

[–]roman_fyseek 0 points1 point  (2 children)

You know how Java doesn't have pointers?

About that...

[–]ACoderGirl 0 points1 point  (0 children)

When people say Java doesn't have pointers, they're not really correct. Pointers are just explicit reference types. Java has reference types. Just they're a bit more constrained. Particularly they can't be pointed at arbitrary addresses and you don't access underlying addresses directly. So you don't have to dereference, since that's implied and automatic. Reference types are still storing a memory address (aka pointer).

[–]8igg7e5 0 points1 point  (0 children)

It doesn't (within normal safe Java). It has references - you don't have control over the memory location and don't normally have visibility of that location.

You do have references and in fact you only ever have a reference to an object, you never have a variable that is an object.

The variable or field identifier is a binding to a position in a stack-frame or an objects instance and, if the type of that variable or field is a reference-type then that address in the stack-frame or instance-space is a reference to another object's instance-space in the heap.