I would like to have a list of classes which could be instantiated later in the program. Something like:
val someClasses = listOf(ClassA, ClassB, ...)
for (myClass in someClasses) {
val myObject = myClass()
myObject.doSomething()
}
Of course it doesn't work. Is it possible to do something like this in Kotlin?