Abstract class:
Adding the keyword "abstract" to the front of a class is an abstract class.
An abstract class that cannot be used as an object. (cannot new) is typically used to refer to a subclass object,
Abstract class Mans {public void Shuohua () { Console.WriteLine (" English ");} }
Abstract method:
Adding the keyword "abstract" before a method is an abstract method.
Public Abstract void Shuohua ()
When you inherit an abstract class from a class, you must override the method. (override keyword),
Public Override void Shuohua () { Console.WriteLine (" English "); }
All abstract methods in the parent class of the abstract class must all be implemented in the subclass.
the abstract method must be in an abstract class. Other methods can appear in an abstract class, but the abstract method must be in an abstract class.
An ordinary method in an abstract class that can only be used in the current class.
abstract classes can only be used as a parent class and cannot create objects.
Abstract Properties:
Can only be used in abstract classes.
Interface:
Interface Keyword interface
Right--add--Add New Item--Select interface
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace jicheng{ interface Interface1 { }}
The interface cannot have fields, methods.
An interface can be seen as a pure abstract class, and all of its methods are abstract. mainly used to specify the method name,
Interface object that requires new to inherit the interface's class:
The name variable name of the interface type = New inherits the name of the class of this interface ();
20141214--abstract base class, interface