I created an abstract inner class with an abstract method in abstract class.
abstract class Qqq{
abstract fun funQqq()
inner abstract class InQqq{
abstract fun funInQqq (s:String)
}
}
When I inherit this class, I don't know how to override an inner class and its method.
class testPhrase:Qqq(){
override fun funQqq() {
TODO("Not yet implemented")
}
override class inQqq{
//??
}
}
I make it for dividing classes methods in to logic parts
I want to get this methods something like this:
val qqqHeir = Qqq()
qqqHeir.inQqq.funInQqq("S")
I understand this is something about having instan in class but don't get how to implement it. Thanks in advance!
You cannot override an inner class but you can extend it.
class testPhrase: Qqq(){
override fun funQqq() {
TODO("Not yet implemented")
}
inner class MyInQqq: InQqq(){
override fun funInQqq(s: String) {
TODO("Not yet implemented")
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With