Tutorial by Examples

1.The Unit return type declaration is optional for functions. The following codes are equivalent. fun printHello(name: String?): Unit { if (name != null) println("Hello ${name}") } fun printHello(name: String?) { ... } 2.Single-Ex...

Page 1 of 1