我试过这样的方法:
private volatile var instanceState: InstanceState = InstanceState.starts
Error: 'Expected member declaration'就像这样:
private volatile var instanceState: InstanceState = InstanceState.starts
Error: 'Property getter or setter expected'不支持Kotlin吗?
发布于 2016-06-16 07:30:52
发布于 2016-06-16 07:28:03
Kotlin没有volatile关键字,而是一个注释:@Volatile (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-volatile/)
https://stackoverflow.com/questions/37852390
复制相似问题