how to access member of outer class from inner class in Kotlin?
Use like this
class A{
lateinit var name: String
inner class B{
fun show(){
print(name)
}
}
}
You should mark class B
as inner
:
class A{
var name: String
inner class B{
fun show(){
print(name)
}
}
}