Pass value and reference

Source: Internet
Author: User

Post:

Http://topic.csdn.net/u/20080721/02/2239b771-79b3-4a53-8fcf-a567a5fc4369.html

... The reference variable stores an address value, so all values are passed, that is, copy them.
Go to the bank to open an account and tell you the card number. When you write the card number on paper (reference variable) and tell others, others (methods) also use a piece of paper (form parameter) write down this card number, and then find the bank account through the card number in this paper.

Ask how much you have:
1. Simple (basic variables), write 100 in a piece of paper and tell you (method) that I only have 100 pieces.
2. complex (reference variable), just a piece of special paper (such paper can only be a bank card number), write the card number on this paper, and then tell you (method ), this is my bank card number (You have to record it with a special paper --> parameter). You can use this card number to check how much I have.

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.