Partial, which is written before the class. It indicates that the class is a part of the class, and you can continue to use the partial class to supplement other parts of the class. I. attributes: methods (functions) in a class generally have three types: constructor, attribute method, and behavior method. Public type attribute name {get {return...;} set {... = value ;}note: 1. attribute is used to assign values and values to member variables. It has an alternative property method. 2. When defining an attribute, there is no parentheses after the attribute name. 3. attributes are public4. attributes can only contain two parts: Get and set. The code can only be written in get and set curly brackets. 5. If the attribute contains only set and does not have get, it is called a read-only attribute; otherwise, it is called a write-only attribute. Both have read and write attributes. Static: static members include static variables, static attributes, and static methods. Static members belong to the class and do not belong to the instance. For example, the standard number of pumping paper. Only one static variable is saved in the memory. Unlike the instance variable, each object is saved in one copy. In C. 1. It is out of curly brackets of the current class (chalk class. Static members can only be called by class names, but cannot be called by instance names. Instance members can only be called by instance objects, but cannot be called by class names. 2. Within the curly brackets of the current class (chalk class. Only static members can be called directly in static methods. The instance method can call non-static and static members. For example, the standard pumping number of paper is a static member, and the actual number of sheets available in each package of paper should be an instance Member. The standard length of chalk is a static member. The available length of each piece of chalk should be an instance Member. Inheritance: members modified by the parent class and subclass 1. Public and protected can be inherited to the subclass. Private modified members cannot inherit from the quilt class. 2. Single inheritance: A parent class can be derived from multiple child classes, but each child class can only have one parent class. 3. when instantiating a subclass, the constructor of the parent class is executed before the constructor of the subclass. 4. The base keyword is used to call the relevant members of the parent class. Base. xxxx () calls the member method of the parent class. Base (...) call the parent class constructor 5. if the parent class has only one constructor with parameters, the Child class must have constructor with corresponding parameters and pass the parameters to the parent class through base.
Object-oriented property 20141011