In Kotlin, suppose I have a class:
class MyKotlinClass { lateinit var field: String }
According to the docs :
Late initialized objects are also displayed as fields. The visibility of the field will be the same as the visibility of setting lateinit properties.
I can use either myKotlinClass.field or myKotlinClass.getField() in java code. I want to disable access to fields and remain only access through getter and setter.
How can I achieve this and save the lateinit modifier?
java kotlin
Michael spitsin
source share