From 7118437c62111a6b5c48fa3248de5f4cde0ff3dc Mon Sep 17 00:00:00 2001 From: esoe Date: Thu, 13 Oct 2022 19:55:58 +0300 Subject: [PATCH] qq --- country/ru/molokoin/Country.java | 44 ------------------ country/ru/molokoin/Map.java | 17 ------- .../{ => src/main/java}/ru/molokoin/Area.java | 2 +- .../src/main/java/ru/molokoin/Country.java | 26 +++++++++++ country/src/main/java/ru/molokoin/Map.java | 32 +++++++++++++ country/target/classes/ru/molokoin/Area.class | Bin 0 -> 1788 bytes .../target/classes/ru/molokoin/Country.class | Bin 0 -> 903 bytes country/target/classes/ru/molokoin/Map.class | Bin 0 -> 1714 bytes 8 files changed, 59 insertions(+), 62 deletions(-) delete mode 100644 country/ru/molokoin/Country.java delete mode 100644 country/ru/molokoin/Map.java rename country/{ => src/main/java}/ru/molokoin/Area.java (93%) create mode 100644 country/src/main/java/ru/molokoin/Country.java create mode 100644 country/src/main/java/ru/molokoin/Map.java create mode 100644 country/target/classes/ru/molokoin/Area.class create mode 100644 country/target/classes/ru/molokoin/Country.class create mode 100644 country/target/classes/ru/molokoin/Map.class diff --git a/country/ru/molokoin/Country.java b/country/ru/molokoin/Country.java deleted file mode 100644 index 1e6e6e0..0000000 --- a/country/ru/molokoin/Country.java +++ /dev/null @@ -1,44 +0,0 @@ -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){ - 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); - 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()"); - - } -} diff --git a/country/ru/molokoin/Map.java b/country/ru/molokoin/Map.java deleted file mode 100644 index 96d4838..0000000 --- a/country/ru/molokoin/Map.java +++ /dev/null @@ -1,17 +0,0 @@ -package country.ru.molokoin; - -public class Map { - private Country[] map = new Country[5]; - public void initDefaults(){ - map[0] = new Country(); - map[0].init("Russia", 17100000, 146700000, "Moscow", 12600000, 0); - } - public static void main(String[] args) { - System.out.println("App.main()"); - Map m = new Map(); - m.initDefaults(); - m.map[0].print(); - m.map[0].getCapital().print(); - - } -} diff --git a/country/ru/molokoin/Area.java b/country/src/main/java/ru/molokoin/Area.java similarity index 93% rename from country/ru/molokoin/Area.java rename to country/src/main/java/ru/molokoin/Area.java index 8f3bba0..35d3130 100644 --- a/country/ru/molokoin/Area.java +++ b/country/src/main/java/ru/molokoin/Area.java @@ -1,4 +1,4 @@ -package country.ru.molokoin; +package ru.molokoin; public class Area { private String name; diff --git a/country/src/main/java/ru/molokoin/Country.java b/country/src/main/java/ru/molokoin/Country.java new file mode 100644 index 0000000..0d99b03 --- /dev/null +++ b/country/src/main/java/ru/molokoin/Country.java @@ -0,0 +1,26 @@ +package ru.molokoin; + +public class Country extends Area{ + private Area capital; + + public Country() { + } + Country(String name, int population, int square, String capitalName, int capitalPopulation, int capitalSquare){ + this.init(name, population, square); + setCapital(new Area(capitalName, capitalPopulation, capitalSquare)); + } + + /** + * @param сapital the сapital to set + */ + public void setCapital(Area capital) { + this.capital = capital; + } + + /** + * @return the сapital + */ + public Area getCapital() { + return capital; + } +} diff --git a/country/src/main/java/ru/molokoin/Map.java b/country/src/main/java/ru/molokoin/Map.java new file mode 100644 index 0000000..65bc8ca --- /dev/null +++ b/country/src/main/java/ru/molokoin/Map.java @@ -0,0 +1,32 @@ +package ru.molokoin; + +public class Map { + private Country[] map = new Country[5]; + public void initDefaults(){ + System.out.println("map.length: " + map.length + " ..."); + //заполняем поля данными + map[0] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); + map[1] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); + map[2] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); + map[3] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); + map[4] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); + } + public static void print(Country[] map){ + System.out.println("Количество государств, данные о которых включены в terra: " + map.length); + int i = 0; + while (i < map.length) { + System.out.println("-------------------------------------------"); + map[i].print(); + map[i].getCapital().print(); + System.out.println("-------------------------------------------"); + i++; + } + + } + public static void main(String[] args) { + System.out.println("App.main()"); + Map terra = new Map(); + terra.initDefaults(); + print(terra.map); + } +} diff --git a/country/target/classes/ru/molokoin/Area.class b/country/target/classes/ru/molokoin/Area.class new file mode 100644 index 0000000000000000000000000000000000000000..77a38b1ff751debb54e50ffc908adda113fc0d26 GIT binary patch literal 1788 zcmaJ>U31$+6g`_b{!o>~wVf7{6x0I6QK(HrAz&9n8X7PSXlk zTE&KIyWhB$Q(W^*BY_yLJ}|yBinig@i???ln0vlJ%rP3KKxT9Bspfl@Q!fiBO}E*y z4c~Gd0Z|o*AAH*~JPMCrw;ao_2u$Xeb_itM-8U6XVn&66GXk@lmSb+U8oQ=<&)Bsk zfxBneJBDZR|7bDhe{CHw`DnF7em;M?q-u3(M}fecigU;kFIT|}FR6GL^8$$j)8CQ} z&5cP9lNVK7z$*gN6uUjtU@RY@Ybq{sK#BrtQNvSB(!@{UbzDy1jpvlC{czx$4Ha)9 zPkOj55_K*t-ExcDoJNA0Mx&g7PHm0qe4}OA`=*z~TO=!QMoCk!gaRu$pQ7I0RxyP* zudS$f2iGXfXf{n}U*O8PCQr#0F_e>dkGd{vgIz5#{`)EtNHTtj@k#ncQsRG5J|t(9 zwa^MBjUhf#kqRN!RNTP2K+<@VUUH zfpAsZHtUAH=G9vb)A4V9zh^etq)BWFYy?k(lc3xCIXDU)_a17&-$7do{tCK5CusK$ zwct_jm);?N=+f|G@TB)saMU{t+QCWhAq97XKeR%jprDEZ8LIxwP}4LUwhK9*PDF}U zpLs;7xh-$c+_2d1DL!-su9?h4zM!)?i3#3GnoY3cawOSkROIgr#i=wa(kN)0(vLCy zh$a)5rFUE|CXuGO8V2AjGW3rDvb4gxr6iiVh0O4vAsHA%gFCD)buRzrRjZkh%wz~ zOiNj~<+K!r8Pk2nOH^mr+gF6gQ7gaWwG%Ae&nzF~ivAeI4z6b2r5DXtJNO`TJ)Bo) z-oeKmd@`s>k^N-pqRh!!LM2zCS_EGs5nF{KxstfP+(vN}VV-JUkO=3(sD3x`s2jo8 z%qgseHdaTmG|IU60xUKP+ktMR2y0s!3CJz{is=(n?`Liu-;Z9%14Bbmv zKyYfqr|G>C%qNI-MjV*$M%zwu3Is9P{_O<-dfME-F$JMoiO z@+9;XOgxd{SSEowmzR3_HdqMQmnceQWa+xYck-k3LK#iHQJMtNv^N;6x@(V3ki)_j zT9l*23GA#KSFIYhmC%+N+O@EU8v^FSPy6SlZTFHSl}Rr*8p&C1=87%?%;R|$$~1^0 z0Wn}miw~Jh*j_KgJkEz3<>}>8`+9jd$|u$+>z;)wYDAqb$!fXntGd`TinCugJ$s?;w}s;1(<8#=&jADkO&v59mx)cUjdq!_QfYJK|h!q|^P5!wVIKy$0u+Is0~L m_uO7B&q^h89}h|_k9(2SHynN;VUd&~1a?=XB=9ira{mIcf}?l< literal 0 HcmV?d00001 diff --git a/country/target/classes/ru/molokoin/Map.class b/country/target/classes/ru/molokoin/Map.class new file mode 100644 index 0000000000000000000000000000000000000000..c17d921ad4f7ad69e1c30567d791793d1a07a88d GIT binary patch literal 1714 zcma)6-E$LF96dLiHrsStN=jR6LmLz{N!vs~MVnge7aC0|5{y=K#%;TX#bh_L+2HUb zqK*&D@G9es4?g({NK>YrW_b2#^QtfW0sal@xk<2vrZZ+HyL-?6KF&G!{`U93w`u@R z;vpj-Lm^6FJ%%@t6JdP!jLa%OM*yj`(e z=Xy$@bK0~_cZPA%SWdt{Z?79cDCpJ@fEqxLK!2OeE|7tS4s`OKF)ibKrMPN1m-N+w zArQ*g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