package example
class Apple {
val APPLE_SIZE_KEY: String = "APPLE_SIZE_KEY"
}
课程:
package example
class Store {
fun buy() {
val SIZE = Apple.APPLE_SIZE_KEY
}
}
Error:
'APPLE_SIZE_KEY' has private access in 'example.Apple'
但是official documentation描述了如果我们不指定任何可见性修改器,默认情况下使用public
.
Why is above error coming?