Kotlin语法笔记,Kotlin Koans 心印

Hello World

案例

1
2
3
4
5
6
7
8
9
10
11
Simple Functions

Take a look at function syntax and make the function start return the string "OK".

In the tasks the function TODO() is used that throws an exception. Your job during the koans will be to replace this function invocation with a meaningful code according to the problem.

fun start(): String = TODO()

简单函数,看看函数语法,让函数start()返回字符串OK

fun start(): String = "OK"

涉及语法