I am talking about this mentally retarded problem. let's take a look at it.

Source: Internet
Author: User
I am talking about it, but this is still a mentally retarded issue. can you refer to Haha... $ anewclass (); $ B $ a; 1)? is $ B getting a copy of $ a or a reference? 2) if $ B references $ a, why does $ B still exist after $ anull? Can it be understood that $ a's copy is assigned to $ b3? if $ B & amp; $ a is written in this way, the result is totally different: $ anull, $ B old-fashioned discussion, this is still a mentally retarded problem. let's take a look at it ..
$ A = new class ();

$ B = $;

1) is $ B a copy of $ a or a reference?

2) if $ B references $ a, why does $ B still exist after $ a = null? Can it be understood that the copy of $ a is assigned to $ B?

3) if $ B = & $ a is written as above, the result is completely different: $ a = null, $ B is also null.

------ Solution --------------------
$ B = $
B is a copy of.
$ B = new class ();

In addition, the variable name is referenced, but the accessed content is the same. the memory address points to the same place. This does not need to be explained.

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.