esoe
2 years ago
7 changed files with 53 additions and 21 deletions
Binary file not shown.
@ -1,32 +1,36 @@ |
|||||||
package ru.molokoin; |
package ru.molokoin; |
||||||
|
|
||||||
public class Map { |
public class Map { |
||||||
private Country[] map = new Country[5]; |
public Country[] map; |
||||||
public void initDefaults(){ |
|
||||||
System.out.println("map.length: " + map.length + " ..."); |
|
||||||
//заполняем поля данными
|
//заполняем поля данными
|
||||||
map[0] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); |
public void initDefaults(){ |
||||||
map[1] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); |
map = new Country[5]; |
||||||
map[2] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); |
//Россия
|
||||||
map[3] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); |
map[0] = new Country("Russia", 146700000, 17100000, "Moscow", 12600000, 0); |
||||||
map[4] = new Country("Russia", 17100000, 146700000, "Moscow", 12600000, 0); |
//Финляндия
|
||||||
|
map[1] = new Country("Finland", 5500000, 338000, "Helsinki", 655000, 0); |
||||||
|
//Франция
|
||||||
|
map[2] = new Country("France", 67800000, 643800, "Paris", 2100000, 0); |
||||||
|
|
||||||
|
//Андора
|
||||||
|
map[3] = new Country("Andorra", 85000, 647, "Andorra la Vella", 22600, 0); |
||||||
|
|
||||||
|
//Сингапур
|
||||||
|
map[4] = new Country("Singapore", 5700000, 725, "", 0, 0); |
||||||
} |
} |
||||||
public static void print(Country[] map){ |
public static void printAll(Country[] map){ |
||||||
|
System.out.println("printAll"); |
||||||
System.out.println("Количество государств, данные о которых включены в terra: " + map.length); |
System.out.println("Количество государств, данные о которых включены в terra: " + map.length); |
||||||
int i = 0; |
int i = 0; |
||||||
while (i < map.length) { |
while (i < map.length) { |
||||||
System.out.println("-------------------------------------------"); |
Country.print(map[i]); |
||||||
map[i].print(); |
|
||||||
map[i].getCapital().print(); |
|
||||||
System.out.println("-------------------------------------------"); |
|
||||||
i++; |
i++; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
public static void main(String[] args) { |
public static void main(String[] args) { |
||||||
System.out.println("App.main()"); |
System.out.println("App.main()"); |
||||||
Map terra = new Map(); |
Map terra = new Map(); |
||||||
terra.initDefaults(); |
terra.initDefaults(); |
||||||
print(terra.map); |
printAll(terra.map); |
||||||
} |
} |
||||||
} |
} |
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue