Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah, true... so what is the difference between a reference and a pointer then?


It depends on which definition of "reference" you are talking about.

Pass-by-reference and C++ references are basically the same - aliasing without requiring dereferencing via an operator.

Java object references are like C++ pointers.

Java is pass-by-value (no aliasing) for all values (ints, bools, object references etc). Java has no object values.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: