Class definition, member-defined modifiers

Source: Internet
Author: User
Tags modifiers

Definition of Class
  Modifier Meaning
1 None or internal Classes can only be accessed in the current project and cannot be accessed after other projects are referenced
2 Public can access the class anywhere
3 Abstract cannot be instantiated, only for inheritance
4 Sealed cannot be used for derivation, can only be instantiated
5 Internal abstract 1+3
6 public abstract 2+3
7 Internal sealed 1+4
8 public sealed 2+4
Definition of a Member
1 Public Members can be accessed by any code.
2 Protected Members can only be accessed by code in a class or derived class.
3 Internal Members can only be accessed by code inside the assembly.
4 protected internal They can only be accessed by the code of the derived class in the assembly.
5 Private Members can only be accessed by code in the class (this keyword is used by default if no keyword is used).
6 Static Declares fields, methods, and properties, which means that they are static members of a class, not members of an object instance

Class definition, member-defined modifiers

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.