Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
fun main() {
    print(Point(0, 1).plus(Point(1, 2)))
}

data class Point(val x: Int, val y: Int) {
    fun plus(other: Point): Point {
        return Point(x + other.x, y + other.y)
    }
}

...

Code Block
languagejava
val sb = StringBuilder()
sb.append("Yes")
sb.append("No")
sb.apply {
    this.append("Yes")
    append("No")
}

Scope Functions

...