Object oriented
OPP: Object-oriented
Class members include: Methods, properties, struct
Class: Divided into two major categories
1. Abstract classes cannot be instantiated, only methods can be overridden in an inherited subclass
2. Sealed class (SEATD) can only be used in the class in which it is currently located
A subclass inherits only one parent class, but can inherit multiple interfaces
Interfaces: Methods defined with the interface keyword
Inheritance: Defines a function or method: The inherited class or the name of the inherited interface
Multiple inheritance is separated by commas
All base classes: System.Object
In one method, if there are more than one function, the constructor is first performed
Constructors: Function names and method names are the same
There is only one constructor in each class, and the default is a non-parametric, non-return constructor
To define a virtual method:
Modifier virtual return value Method name ()
{
Method content
}
Override: Modifier override return value method name ()
{
What is implemented
}
C # Fourth Day