With inheritance, there are many States;
Concept: Inheriting all subclasses of the same parent class, using different, they are a separate individual;
In the ordinary parent class, virtual methods can appear, and virtual methods can be overridden in subclasses;
Virtual method: Virtual
Override: Override
Parent class, base class
Subclass, derived class, Super class
------------------------------------------------------------------
Abstract class: Abstraction
is used to be inherited, cannot instantiate an object, because there is no constructor function;
Abstract methods, can not have the main body of methods, can only define the structure of the method;
Abstract methods or abstract attributes can only exist in abstract classes;
Abstract methods and abstract attributes are not necessarily the only abstractions in the class.
-----------------------------------------------------------------
Interface:
In team development, a class that requires multiple modules to be combined is the complete class;
Multi-personal development of different modules, and finally to put them together, relying on the interface;
A class that needs to inherit multiple classes is complete, but the program stipulates that a class can inherit only one parent class;
In order to solve this problem, there is an interface, a class can inherit countless interfaces;
People in this category, need to eat, skills, sports, is a complete person;
Eating this function is a separate development, as the most basic parent class, using the abstract class;
Skill and movement, which are developed by B and C, require people to inherit this class, but already have the parent class;
Then B and C on the interface used to let people this class can inherit their written two function modules;
The method inside the interface is much like an abstract method;
Interface is also a function of norms and constraints;
IS and as operators:
is to determine if it is a type that returns TRUE or False
o as Ren; if the conversion succeeds, no problem;
If the conversion is not successful, the error is not reported, but a null value is returned
6.19 Outline