Access modifiers for class

Source: Internet
Author: User

The following two illustrations illustrate the same project:

The accessibility of the class is two levels: public and internal;
Classes marked as pubic can be accessed by code in any assembly within the system. If a class is visible to other assemblies,
Use the public access modifier! A class marked internal can only be seen by classes in the assembly in which it resides (the assembly is neither
Program is not DDL). Internal class This is the default accessible level!

You create a new project that is an assembly. The following properties\assemblyinfo.cs is a file about your assembly information. A project may have many source files, often a class that occupies one or more files (although you can put several classes of code in a file, but not recommended). A solution may contain several projects. referencing an external assembly, you can either use the manual copy method or the add References in vs. Some external assemblies are added automatically when you create a new project.

Access modifiers for class

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.