Having a problem understanding what\'s going on n the code below. The behavior of arrays c and d is what I would expect. But what\'s going on with
The array initializer is calling new under the hood (so in this case it's syntactic saccharine). Your swap nearer the top is just swapping references, the one below is performing exactly how you'd expect a reference to perform.
The linked article refers to parameters... In Java all parameters are by value, it's just that references themselves get passed by value i.e. changes to the REFERENCE (not its dereferenced content) won't be reflected outside the scope of the subroutine.