C # graphic tutorials (Fourth Edition) -03- classes and inheritance

1 using the base class reference

  Examples of the derived class   instance of the base class   plus the   derived class new members composition.

  Derived class   reference to   the entire class object point, comprising a base part

  Key: Use reference to the base class part of the object to access the object (the object reference point to the parent class subclass) can only see members of the respective parent class

 

2 override virtual methods and methods

  "Raised" virtual method within a derived class may reference the base class access  

  @ 1 The method of using the base class   virtual method @ 2 are denoted using the derived class override  and a method of the base class of the derived class label @ 3 have the same signature and return value

3 abstract class

   Abstract method must be achieved unless the class is an abstract class inheritance

4 entrusted the operation of the general flow

  @ 1 declare a delegate type

  @ 2 using the delegate type to declare a variable commission

  @ 3 types of objects created delegate

  @ 4 can choose to perform a method of increasing the commission

  @ 5 execution request

Guess you like

Origin www.cnblogs.com/Record-experience/p/12170198.html