Kotlin 与 Scratch 的碰撞

2019-05-14 10:09:47 浏览数 (1)

1.创建 demo 工程:

Currently, scratches are supported only in Kotlin/JVM projects.

2.实际操作

代码语言:javascript复制
val s = "Hello"
val t = "Kotlin"
val st = "$s$t"
println(st)

val a = 1
val b = 2
val c = a   b
println(c)

var sum = 0
for (i in 0..100)
    sum  = i

println(sum)

for(i in 0..9)
    println(i)

参考文档:

https://kotlinlang.org/docs/tutorials/quick-run.html#using-scratches

0 人点赞