For beginners, objects and classes tend to be confusing.
For example: I want to buy a TV, so TV is a class or an object? A single dog, a daughter-in-law is a class or object? Am I a class or an object? Wait a minute.
Let's look at one explanation:
A class is an abstraction of an object that is a concrete instance of a class.
The class is abstract and does not exist, and in computer language it does not occupy memory. The object is specific and occupies a memory space.
Finally, two examples are used to illustrate their relationship:
For example: The class is the fruit, the object is Apple .
Another example is "Human" is a class, then the specific person "Zhang San" is "human" this class of objects,
The "name, age" and other information is the property of the object, human actions such as "eating, dressing" and so on is the object of the method.
Always the same is the set of things with the same characteristics, and the object is a concrete instance of the class.
At the same time, the class has polymorphism and inheritance, such as "human" can be divided into "man, Woman", "Old man, child" then "man, Woman" is the "human" sub-category and so on.
Finally, if you do not understand, you can communicate with me ...
Preliminary understanding of classes and objects