3 ms·
Java and c# are both pass by value (c# has optional ref that must be annotated at both the call site and definition, it also has value structures). Class types
by tubs 3y ago
Java and c# are both pass by value (c# has optional ref that must be annotated at both the call site and definition, it also has value structures).
Class types are effectively pointers that are passed by the value of the pointer.
You cannot implement swap in Java without eg wrapping the params in one element arrays.