-
Notifications
You must be signed in to change notification settings - Fork 0
/
Coche.java
33 lines (27 loc) · 918 Bytes
/
Coche.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
/**
*
* @author Daw120
*
*/
package com.solomongo.ejercicio2;
public class Coche {
//declara los atributos de clase Coche:
private String matricula;
private String velocidad;
private int velocidadCero;
// par de constructores
public Coche(){}
public Coche(String matricula, String velocidad, int velocidadCero){
this.matricula=matricula;
this.velocidad=velocidad;
this.velocidadCero=velocidadCero;
}
// getters que enviaran los datos
public String getMatricula(){ return matricula;}
public String getVelocidad(){ return velocidad;}
public int getVelocidadCero(){ return velocidadCero;}
// seters de aqui para los cambios
public void setMatricula(String matric){this.matricula=matric;}
public void setVelocidad(String veloc) {this.velocidad=veloc;}
public void setVelocidadCero(int veloCero) {this.velocidadCero=veloCero;}
}