4 ms·
Which depends highly on the semantics of the == and = operators. So if in java you decided to create an assign method (cuz remember operators are evil in java)
by fleitz 16y ago
Which depends highly on the semantics of the == and = operators.
So if in java you decided to create an assign method (cuz remember operators are evil in java) and overrode equals then you could create such a situation in which it would return pass by reference.
Plus the equals operator in java is kind of f'ed anyways as it is.
Conversely if the language was pass by value (or not retarded) then code such as this should work.
function f(x, y) { x == y }
a = new String("foo");
b = new String("f").append("oo");
assert(a != b)
if (f(a, b)) {
print('pass by value')
} else {
print('pass by reference')
}