摘要:
In Kotlin, the type system distinguishes between references that can hold null (nullable references) and those that cannot (non-nullable references). 阅读全文
摘要:
A higher-order function is a function that takes functions as parameters, or returns a function. fun <T, R> Collection<T>.fold( initial: R, combine: ( 阅读全文
摘要:
Function parameters can have default values, which are used when you skip the corresponding argument. This reduces the number of overloads: fun read( 阅读全文
摘要:
Properties in Kotlin classes can be declared either as mutable, using the var keyword, or as read-only, using the val keyword. // full syntax for decl 阅读全文
摘要:
A class in Kotlin has a primary constructor and possibly one or more secondary constructors. // primary constructor class Person(val name: String) { v 阅读全文