You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
799 B
32 lines
799 B
2 years ago
|
package country.ru.molokoin;
|
||
|
|
||
|
public class Country extends Area{
|
||
|
private Area capital;
|
||
|
|
||
|
Country(String name, int population, int square, String capitalName, int capitalPopulation, int capitalSquare){
|
||
|
setCapital(capitalName, capitalPopulation, capitalSquare);
|
||
|
setName(name);
|
||
|
setPopulation(population);
|
||
|
setSquare(square);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param сapital the сapital to set
|
||
|
*/
|
||
|
public void setCapital(String name, int population, int square) {
|
||
|
this.capital = new Area(name, population, square);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return the сapital
|
||
|
*/
|
||
|
public Area getCapital() {
|
||
|
return capital;
|
||
|
}
|
||
|
|
||
|
public static void main(String[] args) {
|
||
|
System.out.println("Country.main()");
|
||
|
|
||
|
}
|
||
|
}
|