The definition of object-oriented programming (OOP) lies in a set of core concepts aimed at organizing the program around objects that represent data.
.png)
Object-oriented programming (OOP)
The principle of Object-Oriented Programming (OOP) revolves around organizing a set of interconnected data and functions through objects. Objects are elements that have specific properties and behaviors representing their state and the operations that can be performed on them.
The key concepts of Object-Oriented Programming
The concepts of Object-Oriented Programming are divided into five main concepts, which share a common goal of organizing interconnected data and functions.
1.OBJECT'S:
They are properties with specific behaviors.
2.CLASS:
It's a type of programming construct used to create objects. The class serves as a blueprint or template that describes the data and behaviors objects can have.

In this example, a class named "Car" is defined, which contains three properties: "brand", "model", and "year". Functions "drive" and "stop" are defined to provide behaviors associated with objects created from this class.
3.Inheritance:
It is a programming concept that allows a class to inherit the attributes (data and behaviors) defined in another class.

In this example, the "Dog" class and the "Cat" class inherit properties from the "Animal" class, but each of them overrides the "sound" function to suit the appropriate behavior for each type.
4.Composition:
This is the concept of composition in programming, allowing you to build a complex object by making other objects its parts. In other words, the original objects are structured to form a larger and more complex object.
In this example, the class "Car" includes an object "Engine" as part of it, where we can see the relationship between the car and its engine. When calling the "start" function for the car object, the "start" function for the engine is also executed, demonstrating composition and its usage in programming.
5.Polymorphism:
It is a concept that allows defining and using functions based on the type of object that the function is called for. In other words, polymorphism in programming determines the object's function based on the type of function called for the object.
