How does pass-by-value work with references?
Way too many people say "Java passes primitive by value and objects by reference". This is not the way it should be stated. Java passes everything by value. With primitives, you get a copy of the contents. With references you get a copy of the contents.
Please see the highlighted section,
should that mean "With reference you get a copy of the reference"
Please let me know if i am wrong.
posted 6 years ago
What it means is that you get a copy of the contents of the memory location.
If you have a few hours to spare, have a look at this thread from July.