This commit is contained in:
Avelino
2026-10-02 13:34:17 +02:00
parent 3b21c8f862
commit 6d857d7250
5 changed files with 67 additions and 15 deletions
@@ -9,6 +9,10 @@ public class Continente {
this.codigoContinente = codigoContinente;
this.nombre = nombre;
}
public Continente() {
}
public String getCodigoContinente() {
return codigoContinente;
+3 -6
View File
@@ -51,12 +51,9 @@ public class Pais {
@Override
public String toString() {
return "Pais{" +
"id=" + id +
", nombre = '" + nombre + '\'' +
", capital = '" + capital + '\'' + "," +
continente +
'}';
return nombre + " (" + id + "), con capital en " + capital
+ " pertenece a " + continente.getNombre()
+ " (" + continente.getCodigoContinente() + ")";
}
}