1. Classes and interfaces
In C #, interfaces are responsible for defining functions. In projects, interfaces are used to define classes, while classes are specific functions of negative tables.
A class can inherit a base class, that is, the parent class, but can implement multiple interfaces (the interface actually implements Multi-inheritance ).
The class also has the definition of abstract classes. abstract classes use abstract declarations. abstract classes cannot be listed in real form. abstract classes can have abstract methods and attributes, you can also have specific methods and attributes. That is to say, abstract classes can have abstract methods or specific methods, but classes with abstract methods must be abstract classes.
An interface is only a function definition and a behavior specification. An interface can contain methods and attributes, but these attributes are only defined without an implementation body.
2. Value Type and reference type
The difference between the value type and the reference type is that the variable of the value type directly stores actual data, while the variable of the reference type stores the data address. A Value Type Variable directly stores the value of the variable in the stack, allowing you to quickly access the actual data from the stack. Therefore, the value type indicates the actual data, the reference type variable stores the actual data address in the stack, while the actual data is saved in the heap. Indicates the pointer and reference to data stored in the memory heap (including classes, interfaces, arrays and strings). Therefore, the most basic difference between the value type and the reference type is the memory storage mode.
Value Type reference type variable storage content actual value Reference Memory Unit stack heap transfer parameter actual value reference (object)