Actually in
java there is nothing as "call by reference".
Everything n java is call by value, In case of normal primitive types,they behave as normal call by value passing,
but when we pass objects as parameters, we pass the memory address of that object as call by value, o if you change that memory address it ill not be reflected in the calling function.
But if you change some attributes in that object, they are actually changed at the original location because we have the address of actual variables of that object.
Now in this case you are changing the memory addres to null, which is passed as call by value.