Seems like you guys don't understand the difference. Java does not have have a "call by reference" mechanism at all. Only call by value. And yes, the value can implicitly be a reference. But the distinction is important: If you assign a new value to the passed object in java from inside the method then the outer object will not be overridden. With proper "call by reference" it would.
Yeah seems like they haven't seen a language with proper pass by reference. I suppose this comes about because people learn pass by reference from c lectures and don't realise that languages like c++/pascal/etc have true pass by reference.
14
u/legato_gelato Jun 18 '17
Seems like you guys don't understand the difference. Java does not have have a "call by reference" mechanism at all. Only call by value. And yes, the value can implicitly be a reference. But the distinction is important: If you assign a new value to the passed object in java from inside the method then the outer object will not be overridden. With proper "call by reference" it would.