Skip to content

Instantly share code, notes, and snippets.

View DemoJameson's full-sized avatar

DemoJameson DemoJameson

View GitHub Profile
@lgzh1215
lgzh1215 / Switch.kt
Last active September 8, 2017 03:13
Kotlin劝退流
fun main(vararg args: String) {
val str = "4"
var i = 0
switch(str) {
case("5") { i++; println("case(\"5\")"); 打断() }
case("4") { i++; println("case(\"4\")") }
case("3") { i++; println("case(\"3\")") }
case("2") { i++; println("case(\"2\")"); 打断() }
case("1") { i++; println("case(\"1\")") }
}