C # Basic Knowledge Comparison (object oriented)

Source: Internet
Author: User

    • Private,protected,public and Internal
    1. Private: Is completely private, only this class can use [like their own wife, only you can call, others can not ]
    2. Protected: Can be seen by the outside, but can not be called, only this class and subclasses can call (properties and methods can be called by the Class) [like Dad's Purse, will only use or inherit to his son, just can't give others ].
    3. Private and protected in common: neither can be accessed by the outside world
    4. Publlic: Fully open to any class and member [like a public telephone, anyone can use ]
    5. Internal: Within the same application set (a project in Vs.net, where the project refers to a separate project, not the entire solution) can access the class [like a company phone, only used by company insiders ]
    6. Protected internal: can only be accessed in the consent application set of this class and derived classes [ only persons within the company and subsidiaries of the company may use ]
    7. Public and internal differences: Members of the former can be accessed across assemblies, internal not. But in the same application set, the two have the same effect.
    • Sealed,new,virtual,abstract and override

C # Basic Knowledge Comparison (object oriented)

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.