esoe 2 years ago
parent
commit
dc7f23d7df
  1. 4
      country/ru/molokoin/Area.java
  2. 11
      country/ru/molokoin/Country.java

4
country/ru/molokoin/Area.java

@ -7,6 +7,10 @@ public class Area { @@ -7,6 +7,10 @@ public class Area {
Area(){}
Area(String name, int population, int square){
init(name, population, square);
}
public void init(String name, int population, int square){
setName(name);
setPopulation(population);
setSquare(square);

11
country/ru/molokoin/Country.java

@ -4,15 +4,22 @@ public class Country extends Area{ @@ -4,15 +4,22 @@ public class Country extends Area{
private Area capital;
Country(String name, int population, int square, String capitalName, int capitalPopulation, int capitalSquare){
init(name, population, square, capitalName, capitalPopulation, capitalSquare);
this.init(name, population, square);
this.capital = new Area();
getCapital().init(capitalName, capitalPopulation, capitalSquare);
}
public Country() {
}
public void init(String name, int population, int square, String capitalName, int capitalPopulation, int capitalSquare){
setCapital(capitalName, capitalPopulation, capitalSquare);
/**
* setCapital(capitalName, capitalPopulation, capitalSquare);
setName(name);
setPopulation(population);
setSquare(square);
*/
}

Loading…
Cancel
Save