Kotlin- naming convention for boolean returning methods

Something about naming convention for properties in Kotlin, I know it’s not for methods. But it’s related:

From book Kotlin in Action (by Dmitry Jemerov & Svetlana Isakova) – section 2.2.1 Properties:

In Kotlin, properties are a first-class language feature, which entirely replaces fields and accessor methods.

Listing 2.5. Declaring a mutable property in a class:

class Person {
    val name: String,      // read only property: generates a field and a trivial getter
    var isMarried: Boolean // writable property: a field, getter and a setter
}

Kotlin’s name property is exposed to Java as a getter method called
getName. The getter and setter naming rule has an exception: if the
property name starts with is, no additional prefix for the getter is
added and in the setter name, is is replaced with set.
Thus, from
Java, you call isMarried().

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)