Object-oriented, What Is Object-Oriented
Object-oriented concepts often have some special combinations, such as object-oriented analysis, object-oriented design, and the object-oriented programming implementation we will discuss below.
When programming, we often need to describe something with features that are external or expressive.
During programming, We need to operate on such things according to the characteristics of such things, that is, the process of "abstracting into a class.
C ++ provides three access permissions for members in the class: public, protected, and private. Represents all public, protected, and private.
For example, every student in a class has a student ID, score, and ranking ......
Therefore, what we need is to abstract a class )"
If they are all students, we can call this class "student" and write some member variables to describe them based on our needs.
Class student {
Public:
Int num;
Int age;
Int mc;
};
Now we have created a class. If there is a student named Tom, we can declare it in the main function as follows:
Student Tom;
Next we will assign values to Tom's student ID, score, and ranking attributes:
Tom. num = 15254264;
Tom. age = 85;
Tom. mc = 5;
In this way, we can describe the students in a class effortlessly.