Getters and Setters in Kotlin
Getters and setters are auto-generated in Kotlin. If you write: val isEmpty: Boolean It is equal to the following Java code: private final Boolean isEmpty; public Boolean isEmpty() { return isEmpty; } In your case the private access modifier is redundant – isEmpty is private by default and can be accessed only by a getter. … Read more