Key words:
Virtual: Virtual method, itself can be instantiated, you can also override the method in a derived class;
Override: Declared when a derived class overrides a base class virtual method, avoiding potential run errors in C + +;
Abstract: The declaration of a class, abstract methods, can not be instantiated;
Sealed: Cannot be inherited class, cannot be overridden method;
Modifier:
Protected: Only itself with derived types can be accessed;
Private: can only be accessed within the owning type;
Internal: can only be accessed in the assembly that contains it;
Interface:
A syntax declaration is exactly the same as an abstract class, but does not allow the implementation of any member of the interface;
Overloaded operators are not allowed when defining interfaces;
General use IXXX (); Custom
Interface Inheritance:
Class inherits interfaces: All members and methods must be instantiated;
Interface Inheritance interface: The new interface will have all the members of the original interface and their new members;
The difference between Interface and Abstract:
Borrowing a Java distinction differs from C #, but the subject concept is similar.
Borrowing the above summary, the main difference in C # is:
1. Class cannot inherit multiple, interface can inherit multiple;
2. Members of a class can be publicly owned, and interfaces are public;
IS and as operators:
Is: Checks whether an object is compatible with the specified type and returns a Boolean value;
As: Coercion type conversion, the ability to convert to return an instance, not to return null, if (obj is ClassA) {Class A = (ClassA) obj;} merge for the same sentence: ClassA A = obj as ClassA;
C # Partial keywords