VOs con constructores

This commit is contained in:
Isidoro Nevares Martín 2026-03-09 17:14:52 +01:00
parent 8c47a2ed9e
commit 1314216578
3 changed files with 21 additions and 1 deletions

View File

@ -40,5 +40,6 @@
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -23,7 +23,20 @@ public class Alumno {
public int getIdentificador() {
public Alumno(int identificador, String nombre, String apellido1, String apellido2, LocalDate fechaNacimiento,
String esRepetidor, String telefono, Casa casa) {
super();
this.identificador = identificador;
this.nombre = nombre;
this.apellido1 = apellido1;
this.apellido2 = apellido2;
this.fechaNacimiento = fechaNacimiento;
this.esRepetidor = esRepetidor;
this.telefono = telefono;
this.casa = casa;
}
public int getIdentificador() {
return identificador;
}

View File

@ -13,6 +13,12 @@ public class Casa {
private int identificador;
String nombre;
public Casa(int identificador, String nombre) {
super();
this.identificador = identificador;
this.nombre = nombre;
}
public int getIdentificador() {
return identificador;
}