What exactly does “pass by reference” mean?

后端 未结 8 2154
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 03:15

And who has the authority to decide?

Edit: Apparently I haven\'t succeeded in formulating my question well.
I am not asking how Java\'s

8条回答
  •  北海茫月
    2020-12-30 04:00

    Java doesn't pass by reference. You are always passing a copy/by value. However if you pass an object then you will get a copy of the reference. So you can directly edit the object, however if you overwrite your local reference then the original object reference won't be overriden.

提交回复
热议问题