【文章內(nèi)容簡(jiǎn)介】
ass definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C, a struct is like a lightweight class。 it is a stackallocated type that can implement interfaces but does not support inheritance. In addition to these basic objectoriented principles, C makes it easy to develop software ponents through several innovative language constructs, including the following: Encapsulated method signatures called delegates, which enable typesafe event notifications. Properties, which serve as accessors for private member variables. Attributes, which provide declarative metadata about types at run time. Inline XML documentation ments. LanguageIntegrated Query (LINQ) which provides builtin query capabilities across a variety of data sources. If you have to interact with other Windows software such as COM objects or native Win32 DLLs, you can do this in C through a process called Interop. Interop enables C programs to do almost anything that a native C++ application can do. C even supports pointers and the concept of unsafe code for those cases in which direct memory access is absolutely critical. The C build process is simple pared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C source file may define any number of classes, structs, interfaces, and events. The following are additiona