在 kotlin 中定义具有公共 getter 和私有(仅内部可修改)setter 的 var 的正确方法是什么?
var setterVisibility: String = "abc" // Initializer required, not a nullable type
private set // the setter is private and has the default implementation
See: 属性 Getter 和 Setter http://kotlinlang.org/docs/reference/properties.html#getters-and-setters
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)