-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersona.java
More file actions
81 lines (72 loc) · 1.79 KB
/
Persona.java
File metadata and controls
81 lines (72 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package poop7;
/**
* Esta es la clase Persona.
* @author ドディス
*/
public class Persona {
private String nombre;
private int edad;
private double estatura;
/**
* Constructor vacío
*/
public Persona() {
}
/**
* Este es el constructor que recibe tres parámetros.
* @param nombre Es el nombre de la persona, de tipo String.
* @param edad Es la edad de la persona, de tipo int.
* @param estatura Es la estatura de la persona, de tipo double.
*/
public Persona(String nombre, int edad, double estatura) {
this.nombre = nombre;
this.edad = edad;
this.estatura = estatura;
}
/**
* Devuelve el atributo nombre.
* @return nombre
*/
public String getNombre() {
return nombre;
}
/**
* Permite modificar el atributo nombre.
* @param nombre
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* Devuelve el atributo edad.
* @return edad
*/
public int getEdad() {
return edad;
}
/**
* Permite modificar el atributo edad.
* @param edad
*/
public void setEdad(int edad) {
this.edad = edad;
}
/**
* Devuelve el atributo estatura.
* @return estatura
*/
public double getEstatura() {
return estatura;
}
/**
* Permite modificar el atributo estatura.
* @param estatura
*/
public void setEstatura(double estatura) {
this.estatura = estatura;
}
@Override
public String toString() {
return "Persona{" + "nombre=" + nombre + ", edad=" + edad + ", estatura=" + estatura + '}';
}
}