Category | A class serves as a design blueprint to create a code segment of an object. It describes the characteristics of the object; what attributes the object has, how to use the object to complete some tasks, how it responds to events, etc.! |
---|---|
Object | An object is an instance of a class, usually created by calling a constructor of the class! |
Method | Methods are functions defined in a class. Generally speaking, a method describes an operation that an object can perform! |
Attributes | Attributes are variables defined in a class. The attributes of a class highlight the nature or status of an object. In some cases, users of an object may not be allowed to change certain properties of the object because the creator of the class has stipulated that those properties cannot be changed by users. It's like you can only know that I'm a boy, but you can't change it! |
Event | Events are object methods triggered by some external behavior. It can be associated with user behavior (such as clicking a Button) or system behavior. |
Constructor | The constructor is a special method called to create an object. In VB, the creation of an object is achieved by creating a process named new in a given class! |
Destructor | The destructor is a special method called when releasing an object. In VB, in order to write a destructor, we must override the Dispose method of the base class. However, because the CLR automatically performs garbage collection, you rarely need to explicitly call the destructor in managed code. Then, when running resources outside the CLR (such as devices, file handles, network connections, etc.), the Dispose method should be called to ensure the performance of the computer! |
Rewrite | Overriding is an object-oriented concept, which stipulates that a derived class can create different implementation codes of a method of its base class. In fact, it completely overrides what the method in the base class does! |
Interface | An interface is a convention that defines the structure of methods, properties, times, and indexers. We cannot create objects directly from an interface, but must first implement the characteristics defined by the interface by creating a class! |
Encapsulation | Encapsulation is a concept. Its meaning is to integrate methods, properties, and events into a unified class and shield the details from users. An example of encapsulation is a car - we operate the steering wheel , brake and accelerate to operate the car. Good packaging does not require us to consider fuel ejection, flow issues, etc. |
Reload | He stipulates that a method can have many different interfaces, but the name of the method is the same. |
Inherit | Inherited classes are extensions of inherited classes. Inheritance is a mechanism for subclasses to automatically share the data structures and methods of parent classes. This is a relationship between classes. When defining and implementing a class, It can be done on the basis of an existing class, using the content defined by the existing class as its own content, and adding some new content. |
Polymorphic | It stipulates that the same function can have different implementations for different objects. For example, an Add method can perform both the addition and summing of integers and the concatenation of strings! |
Note: The source of the above content is "Baidu Encyclopedia:Object-oriented"