Object
An object is a data structure (state) with a set of functions specific to the object that give a different result depending on the state of the object (its attributes).
Introduction
Object-oriented programming was born with Simula in 1962, and its origin is to simulate objects and interactions between objects.
An object is a data structure (state) with a set of functions specific to the object that give a different result depending on the state of the object (its attributes).
Finally, remember that object-oriented programming is invaluable in creating user interfaces, real object simulation programs (such as 3D design), etc., but not in managing processes that process data such as artificial intelligence, web services, etc.
Object
Data structure
Every programming language is composed of simple data structures that allow you to represent anything, for example, a rectangle:
= 3
= 6But if we have two rectangles, how can we represent them?
= 3
= 6
= 5
= 10It’s not a good solution. What if we use a list?
=
= In this way, we have the properties of a rectangle grouped in a single data structure under a single reference.
Functions
What if we want to calculate the area of a rectangle?

return *
assert == 12Estás leyendo una vista previa.
Inicia sesión para leer el artículo completo. Cualquier cuenta abre 4 artículos gratuitos al mes; el alumnado y el profesorado leen las páginas de su curso sin límite.
Iniciar sesión