Last active
January 12, 2020 13:44
-
-
Save darrenbkl/496f1476bf4d71aabe9a380b4bc371b1 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) { | |
explorer.visit(planet); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment