[Excerpt] Parameter Passment in Java (2)

xiaoxiao2021-03-06  48

Original address: Classic java problem, can you answer a few?

Classic java problem, can you answer a few? Thirty, when an object is passed as a parameter to a method, this method can change the properties of this object and return the resulting result, then here is the value delivery or reference delivery?

It is a value transfer. The Java programming language is only passed by the value. When an object instance is transmitted to the method as a parameter, the value of the parameter is a reference to the object. The content of the object can be changed in the called method, but the reference to the object will never change.

转载请注明原文地址:https://www.9cbs.com/read-81099.html

New Post(0)