Last active
January 12, 2020 13:46
-
-
Save darrenbkl/9324992f8fd5bcccde0946b716907654 to your computer and use it in GitHub Desktop.
This file contains 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
Planet mars = new Mars() | |
Planet saturn = new Saturn(); | |
Planet mercury = new Mercury() | |
Explorer explorer = new LifeExplorer(); | |
List<Planet> planetsToBeVisited = new ArrayList<>(); | |
planetsToBeVisited.add(mars); | |
planetsToBeVisited.add(saturn); | |
planetsToBeVisited.add(mercury); | |
for (Planet planet : planetsToBeVisited) { | |
planet.accept(explorer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment