标签:区别 outer string import load 获取 color span otl
就是类中定义类
package loaderman.demo class Outer { var name: String = "name" inner class inner {//inner关键字获取外部类的实例引用 fun getName(): String = name } class Ha{ fun go()=3 } }
package loaderman import loaderman.demo.Outer fun main(arg: Array<String>) { val name = Outer().inner().getName()//注意 Outer()和Outer区别 val go = Outer.Ha().go() println(name) println(go) }
标签:区别 outer string import load 获取 color span otl
原文地址:https://www.cnblogs.com/loaderman/p/10126153.html