-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPasajero.java
More file actions
78 lines (65 loc) · 1.68 KB
/
Pasajero.java
File metadata and controls
78 lines (65 loc) · 1.68 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
public class Pasajero
{
private String nombre;
private String apellido;
private int numDocumento;
private String [] equipajes;
//Constructor vacío
public Pasajero()
{
this.nombre = "";
this.apellido = "";
this.numDocumento = 0;
this.equipajes = new String[3];
this.equipajes[0] = "";
this.equipajes[1] = "";
this.equipajes[2] = "";
}
//Constructor con datos
public Pasajero(String nombre, String apellido, int numDocumento, String [] equipajes)
{
this.nombre = nombre;
this.apellido = apellido;
this.numDocumento = numDocumento;
this.equipajes = equipajes;
}
void setNombre(String nombre)
{
this.nombre = nombre;
}
void setApellido(String apellido)
{
this.apellido = apellido;
}
public void setNumDocumento(int numDocumento)
{
this.numDocumento = numDocumento;
}
public void setEquipajes(String [] equipajes)
{
this.equipajes = equipajes;
}
public String getNombre()
{
return this.nombre;
}
public String getApellido()
{
return this.apellido;
}
public int getNumDocumento()
{
return this.numDocumento;
}
public String [] getEquipajes()
{
return this.equipajes;
}
public String toString()
{
return " Nombre: "+this.nombre+"\n"+
" Apellido: "+this.apellido+"\n"+
" Documento: "+this.numDocumento+"\n"+
" Equipajes: "+this.equipajes[0] + " , " + this.equipajes[1] + " , " +this.equipajes[2];
}
}