sealed class MySealedClass {
data class MyDataClassInsideSealed(): MySealedClass()
}
Wouldn't this cause an infinite loop?
sealed class MySealedClass {
data class MyDataClassInsideSealed(): MySealedClass()
}
Wouldn't this cause an infinite loop?
Copyright © 2021 Jogjafile Inc.
No, this does not cause an infinite loop. A sealed class is abstract by itself, it cannot be instantiated directly. Therefore it doesn't really
contain
itself, in the way you are thinking.