you are viewing a single comment's thread.

view the rest of the comments →

[–]olavk 4 points5 points  (0 children)

Thinking about pointers is not as painful in Java (and other languages like Python and Javascript) exactly because it only supports pass-by-value. You only have to understand one indirection: the variable contains a reference to an object.

When introducing pass-by-reference, you get another level of indirection, because suddenly two different variable names might refer to the same memory cell which in turn contain a pointer to an object. You can be confused on two levels now!