📅  最后修改于: 2022-03-11 14:53:33.428000             🧑  作者: Mango
// Kotlin
class KotlinClass {
val fixed: String = "base.KotlinClass"
var mutable: Boolean = false
}
// Java
KotlinClass kotlinClass = new KotlinClass();
String s = kotlinClass.getFixed(); // Uses getter of ‘val’
kotlinClass.setMutable(true); // Uses setter of ‘var’
boolean b = kotlinClass.getMutable(); // Uses getter of ‘var’