Is a Java object pass a value pass or a reference pass?

Source: Internet
Author: User

The question to tell the truth I don't feel much significance,

By first impressions and some ideas of C + +, object passing is a reference pass, because the value of the passed object can be changed.

But there are many people, do not know where to deduct from a sentence, Java only value is passed, there is no reference to pass. The theory is that Java objects pass through the value of the address as a parameter, not the object itself, so this is also a value pass.

After reading this theory, I was a little puzzled, C + + has never said that the reference passed by the object itself Ah, passed is also the address value.

So there's no reference passed in C + +?

I feel this is a word game, everyone said is the same thing, but not to fight the death.

So I still think that's the quote pass.

Is a Java object pass a value pass or a reference pass?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.