Created
January 2, 2020 08:58
-
-
Save kajetan-suchanski/cb995a099dfce27fec62e3b5de8bfbe8 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
class ApplePie | |
class Cheesecake | |
class Coffee | |
fun listOfAnyExample() { | |
val listOfAny = listOf<Any>(ApplePie(), Cheesecake(), Coffee()) | |
listOfAny.forEach { println("I am ${it.javaClass.simpleName}.") } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment