News for hackers. Stuff that matters.
Re:Java is Pass-by-Value, Dammit by lucio on Sunday March 22, 2015 @09:50AM (#9246722)
>You can't take the address of a primitive or object and pass that.

Not correct.

In Java, if you have an object you take the address and pass it. If you have a primitive, you pass a copy of the value. Both things are called "pass-by-value" (something that confuses a lot of people).

Re:Java is Pass-by-Value, Dammit by jjnoakes on Sunday March 22, 2015 @11:00AM (#9246928)
Java has no notion of "taking the address of an object" because you never have an expression that refers to an object directly. You only have the addresses, so there's no need (or way) to convert objects to their address.

And it's all pass by value (for all values you could have - numbers, addresses, booleans, whatever).

Re:Java is Pass-by-Value, Dammit by kelnos on Wednesday March 25, 2015 @09:04PM (#9267166)
Heh, see why this is so confusing? That is of course what I meant -- it's really that Java, passing-wise, just has primitives and addresses to objects.