|
|
|
|
87
|
|
87
|
|
88
|
###Objetos
|
88
|
###Objetos
|
89
|
|
89
|
|
90
|
-Un objeto es un ente que contiene datos (al igual que una variable), llamados sus `atributos`, y también contiene procedimientos, llamados `métodos`, que se usan para manipularlos. Los objetos son "instancias" de una clase que se crean de manera similar a como se definen las variables, con la excepción de que en ocasiones hay que añadir parámetros:
|
|
|
|
|
90
|
+Un objeto es un ente que contiene datos (al igual que una variable), llamados sus `atributos`, y también contiene procedimientos, llamados `métodos`, que se usan para manipularlos. Los objetos son "instancias" de una clase que se crean de manera similar a como se definen las variables, con la excepción de que en ocasiones hay que añadir valores para los parámetros:
|
91
|
|
91
|
|
92
|
-`NombreClase nombreObjeto(parametros);`
|
|
|
|
|
92
|
+`NombreClase nombreObjeto(argumentos);`
|
93
|
|
93
|
|
94
|
La creación de los objetos la hacen unas funciones llamadas `constructores` que explicaremos más adelante. Una vez creamos un objeto, podemos interaccionar con él usando los métodos de la clase a la que pertenece.
|
94
|
La creación de los objetos la hacen unas funciones llamadas `constructores` que explicaremos más adelante. Una vez creamos un objeto, podemos interaccionar con él usando los métodos de la clase a la que pertenece.
|
95
|
|
95
|
|
|
|
|
|
460
|
|
460
|
|
461
|
###Objects
|
461
|
###Objects
|
462
|
|
462
|
|
463
|
-An object is an entity that contains data (as well as a variable), called its `attributes`, and also contain procedures, called `method`, that are used to manipulate them. The objects are "instances" of a class that are created in a similar manner as how variables are defined, with the exception that in some occasions we have to add parameters:
|
|
|
|
|
463
|
+An object is an entity that contains data (as well as a variable), called its `attributes`, and also contain procedures, called `method`, that are used to manipulate them. The objects are "instances" of a class that are created in a similar manner as how variables are defined, with the exception that in some occasions we have to add values for the parameters:
|
464
|
|
464
|
|
465
|
-`ClassName objectName(parameters);`
|
|
|
|
|
465
|
+`ClassName objectName(arguments);`
|
466
|
|
466
|
|
467
|
The creation of the objects is done by functions called `constructors` that will be explained later. By creating an object we have available the methods of the class that the object belongs to.
|
467
|
The creation of the objects is done by functions called `constructors` that will be explained later. By creating an object we have available the methods of the class that the object belongs to.
|
468
|
|
468
|
|