Skip to content

Instantly share code, notes, and snippets.

@SIRHAMY
Created January 8, 2016 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SIRHAMY/2a0e8d175ddc14010f48 to your computer and use it in GitHub Desktop.
Save SIRHAMY/2a0e8d175ddc14010f48 to your computer and use it in GitHub Desktop.
WorldProblem Constructor Example
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