C # modifier Summary

Source: Internet
Author: User

The modifier in C # is used to define the type and member method. net3.5 has the following types:

Modifier description
Access modifiers public, private, protected, internal, and protected internal. For details, see:
Http://blog.csdn.net/tjvictor/archive/2009/06/24/4293354.aspx
Abstract: Specifies a class as an abstract class.
Const specifies that the value of a field or local variable cannot be modified, that is, it is modified as a constant.
Event declares an event.
Extern indicates that a method is implemented externally, generally in. netProgramUsed to call external WIN32API.
New hides members inherited from base class members.
Override overrides the member inherited from the base class member.
Partial defines the Division class and structure throughout the same program. You can simply write the same class in different. CS files.
Readonly declares that a field or variable is read-only and can only assign values to this field or variable when declaring or constructing a function.
The modified class specified by sealed cannot be inherited by other classes.
Static specifies a static field, variable, class, and method.
UnsafeCodeIn C.
Virtual modifies a method as a virtual method so that this method can be overwritten in its inheritance class. It is generally used in combination with override and new.
Volatile indicates that the field can be modified in the program by the operating system, hardware, or concurrent execution thread. The volatile keyword indicates that the field may be modified by multiple concurrent execution threads. Fields declared as volatile are not restricted by Compiler Optimization (assuming that they are accessed by a single thread. This ensures that the field displays the latest value at any time.

This article from csdn blog: http://blog.csdn.net/tjvictor/archive/2009/06/25/4297190.aspx

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.