classes and members

1. Concept

Classes are the result of abstracting things in the real world.

The relationship between classes and objects

An object, also called an instance, is an entity in memory obtained after a class is "instantiated". 
What is the difference between "airplane" and "a plane". 
Some classes cannot be instantiated, such as "mathematics" 
using the new operator to create an instance of the class to 
reference the relationship between variables and instances

3. Three members of the class

Properties (data) (small list icon)
store data, combined to represent the current state of the
class or object Model class or object focus on properties such as Entity Framework

The method (algorithm) (small square icon)
indicates what the class or object can do.
The tool class or method focuses on the method, such as Math, Console

Event (small lightning icon)
class or object notifying mechanism of other classes or objects
notifying class or object about time, such as Timer

4. Static members and instance members

Static members mean "members of a class". For example, in the MSDN document of the total number of humans and average height
, the uppercase S on the attribute is a static attribute

Instance (non-static) members mean "members of an object". person's height, person's weight

Binding refers to how the compiler associates a member with a class or object.
Late binding is also called dynamic binding.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325189170&siteId=291194637