Access modifiers in C #

Source: Internet
Author: User

Public: Public, public Private: Private, only inCurrent ClassThe internal access protected: Protected, only inthe inner of the current classAnd this class ofsub-classAccess in the. Internal: Only inCurrent ProjectAccess in the. In the same project, the permissions for internal and public are the same. Internal protected:Internal+protected (protected under current project)1), there are only two access modifiers that can modify a class: public, Internal. 2), the subclass's access rights cannot be higher than the parent class's access rights, it will burst the members of the parent class. Type before, access modifier: public internal (default)--modifiers for polymorphism: abstract (abstraction class, cannot be instantiated) sealed (Sealed, not allowed to be inherited) static (static, in contrast to polymorphism)--access modifier public internal private (default ) protectedInternalprotected  --polymorphism modifiers for virtual abstract override sealed static

Access modifiers in C #

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.