From dc7f23d7df269a8d909cdbc9e20698628eef8d69 Mon Sep 17 00:00:00 2001 From: esoe Date: Thu, 13 Oct 2022 17:00:57 +0300 Subject: [PATCH] qq --- country/ru/molokoin/Area.java | 4 ++++ country/ru/molokoin/Country.java | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/country/ru/molokoin/Area.java b/country/ru/molokoin/Area.java index 0c41d0f..8f3bba0 100644 --- a/country/ru/molokoin/Area.java +++ b/country/ru/molokoin/Area.java @@ -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); diff --git a/country/ru/molokoin/Country.java b/country/ru/molokoin/Country.java index a678d3e..1e6e6e0 100644 --- a/country/ru/molokoin/Country.java +++ b/country/ru/molokoin/Country.java @@ -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); + */ + }