如何在Kotlin中创建一个具有私有getter(或根本没有)但具有公共setter的属性?
var status
private get
出现错误时不工作:Getter visibility must be the same as property visibility
In my case, the reason is for Java interop: I want my Java code to be able to call setStatus
but not getStatus
.