1. There are two methods to access the members or methods of the base class in a derived class:
1). C # Call the method Member of the base class by using base. <Method Name>.
2). Convert the display type.
2. Hide base class members
Sometimes the same function needs to implement new logic in the derived class again, instead of using the base class method, that is, hiding the member methods of the parent class. New modifier to hide base class members.
3. The sealed class and method use the keyword (sealed)
4. abstract classes and abstract methods (Abstract)
Abstract methods are generated for inheritance. The base class does not implement any specific code execution, but is just a definition. The subclass must override the abstract method in the base class by using the keyword (override)
5. Multiple inheritance uses interfaces.
To implement methods with the same name for multiple interfaces, you must pay attention to the following two points in the interface implementation section;
1) The method with the same name is implemented. keywords such as public cannot be added before, and the corresponding interface name must be used for each method. For example
Void iface1.say (){....};
Void iface2.say (){....};
2) For methods with different names, the preceding method must be in the "public" notation. For example;
Public void Hello ()
The preceding two rules are indispensable; otherwise, a compilation error is returned.
Namespace consoleapplication2 {interface iface1 {void say (); void Hello ();} interface iface2 {void say (); void goodbye ();} class facetoface: iface1, iface2 {void iface1.say () {console. writeline ("this is the iface1 method");} public void Hello () {console. writeline ("iface1 hello");} void iface2.say () {console. writeline ("this is the iface2 method");} public void goodbye () {console. writeline ("goodbye of iface2") ;}} class program {static void main (string [] ARGs) {facetoface FS = new facetoface (); (iface1) FS ). say (); (iface2) FS ). say (); FS. goodbye (); FS. hello (); console. read ();}}}