In Kotlin, how costly is the casting of classes?
So for instance, let's have the following Test
class
open class Test {
open fun question() = "Basic question"
}
and 3 inheriting classes
class MathTest : Test() {
override fun question() = "2+2=?"
}
class EnglishTest : Test() {
override fun question() = "Who created SO?"
}
class HistoryTest: Test() {
override fun question() = "When was SO created?"
}
How costly would it be to cast (for instance, let's say) 100 Test
objects to either one of these 3, at runtime, in Android (and in general) ?