-
Notifications
You must be signed in to change notification settings - Fork 0
/
TAuto.java
68 lines (51 loc) · 1.48 KB
/
TAuto.java
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
//JESUS HUERTA AGUILAR - FACULTAD DE CIENCIAS DE LA COMPUTACION
//---------> TAuto
class TAuto extends TVehiculo{
//ATRIBUTOS
private String tipo;
private int no_bolsasaire,capacidad_cajuela;
//METODOS CONSTRUCTORES
TAuto(){
super(); //MANDO A LLAMAR AL CONSTRUCTOR DE LA CLASE PADRE
tipo = "";
no_bolsasaire = 0;
capacidad_cajuela = 0;
}
TAuto(String tipo_combustible,String modelo,String marca,
int no_cilindros,int no_llantas,int no_personas,String tipo
,int no_bolsasaire,int capacidad_cajuela){
super(tipo_combustible,modelo,marca,no_cilindros,no_llantas,no_personas);
setTipo(tipo);
setNoBolsasaire(no_bolsasaire);
setCapacidadCajuela(capacidad_cajuela);
}
//METODOS SET
public void setTipo(String tipo){
this.tipo = tipo;
}
public void setNoBolsasaire(int no_bolsasaire){
this.no_bolsasaire = no_bolsasaire;
}
public void setCapacidadCajuela(int capacidad_cajuela){
this.capacidad_cajuela = capacidad_cajuela;
}
//METODOS GET
public String getTipo(){
return tipo;
}
public int getNoBolsasaire(){
return no_bolsasaire;
}
public int getCapacidadCajuela(){
return capacidad_cajuela;
}
//METODOS DIVERSOS
@Override //SOBREESCRITURA DEL METODO DE LA CLASE PADRE
public String toString(){
String cadena;
cadena = super.toString() + " | Tipo: " + tipo + "\n" +
" | No. de bolsas de aire: " + no_bolsasaire + "\n" +
" | Capacidad de la cajuela: " + capacidad_cajuela + "kg. \n";
return cadena;
}
}//FIN DE LA CLASE