Walking and jumping are functions. These are actions that a little man can perform. If we were writing a program, then the men.Walk function is a procedural program. One parameter and one action. Now let’s add other objects. For example, little men from different continents: africa, asia and europe. They have a similar set of parameters (men). But there are also their own – skin color, height, weight, hair color, tone of voice, age, etc. According to the rules of procedural programming, we would put all the parameters in one box – the program is ready.
In real life this is how mixed races turn
An for the new little man, they copied and pasted variables and functions again and again. Imagine how much code! According to the principles of oop, the general Mexico Phone Number List characteristics are made up of boxes — objects. And they interact with each other. For example, a box of little men from europe will take the general characteristics from one box, adding their own. As you can see, the boxes with the parameters of the little men are also connected to each other. out: mestizos, mulattoes, and others. They didn’t rewrite anything, but simply mixed ready-made boxes — objects. This is how you can combine many things in the world.
The main principles of oop four rules
For example, animals have many functions that humans use: walking, running, jumping. Vegetables and fruits have their own program on oop. And for computer mice and keyboards their own. Everything is interconnected and is in its own boxes. define USA Business how objects are connected in oop: encapsulation, abstraction, inheritance, and polymorphism. Without them, nothing can be done in object-oriented programming. For example, if you remove the box with the main characteristics of the little men, the others will not stop working. They will take the same characteristics, but leave them inside their box. abstraction each object has an internal interface .