Created
February 12, 2022 13:20
-
-
Save arsalankhan994/4a1b3eb53ca045103a88668ef2126d67 to your computer and use it in GitHub Desktop.
Revisions
-
arsalankhan994 created this gist
Feb 12, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ fun main() { // Multi Condition in Kotlin using when/else val list = listOf("Erselan Khan", 27, "arsalankhan994@gmail.com") when(list[(list.indices).random()]) { "Erselan Khan" -> println("name is ${list[0]}") 27 -> println("age is ${list[1]}") "arsalankhan994@gmail.com" -> println("email is ${list[2]}") else -> println("Else condition") } }