Is parameter passing in Java passed by value or by reference?

王林
Release: 2020-07-30 17:12:19
forward
2278 people have browsed it

Is parameter passing in Java passed by value or by reference?

It is generally believed that the transfer in Java is by value, and the transfer of instance objects in Java is by reference.

(Recommended tutorial: java introductory tutorial)

What is passing by value and passing by reference?

Value transfer: A copy of the object is passed. Even if the copy is changed, it will not affect the source object;

(Video tutorial recommendation: java video tutorial)

Passing by reference: What is passed is not the actual object, but a reference to the object; changes to external objects will be reflected in the actual object;

The above is the detailed content of Is parameter passing in Java passed by value or by reference?. For more information, please follow other related articles on the PHP Chinese website!

source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!