what is the difference between pass by reference and call by reference?

后端 未结 3 773
予麋鹿
予麋鹿 2021-01-02 15:05

what is the difference between pass by reference and call by reference in java ?

3条回答
  •  情歌与酒
    2021-01-02 16:04

    Important concept - Java has no concept of "pass by reference". Everything in Java is passed by value. When you pass an object reference to a parameter in a method call, what you are really doing it is passing a value that points to the reference of your object.

    The following URLs explain this in greater detail: http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html and http://javadude.com/articles/passbyvalue.htm?repost

    Apparently (as noted in comments to your question) the terms "pass by reference" and "call by reference" mean the same thing.

提交回复
热议问题