Created
January 8, 2016 04:09
-
-
Save SIRHAMY/2a0e8d175ddc14010f48 to your computer and use it in GitHub Desktop.
WorldProblem Constructor Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
World myWorld = new World( | |
new Country("USA", | |
new State("NY", | |
new City("New York", 8143197)), | |
new City("LA", 3844829), | |
new City("Chicago", 2842518), | |
new District("Washington D.C.", 658893)), | |
new Country("Germany", | |
new City("Berlin", 3336026), | |
new City("Hamburg", 1605606), | |
new City("Munich", 831937)), | |
new Country("Tamriel", | |
new State("Skyrim", | |
new City("Dragonsreach", 580), | |
new City("Falkreath", 390), | |
new District("Sheogorath's Realm", 666)), | |
new State("Morrowind", | |
new City("Seyda Neen", 46)))); | |
myWorld.printPopulation(); | |
System.out.println(); | |
myWorld.printWorld(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment