Created
July 8, 2019 13:16
-
-
Save myanmarlinks/efe7221334f25121af4439afe3a29c90 to your computer and use it in GitHub Desktop.
Bridge to Kotlin Part 8
This file contains 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 characters
fun main(args: Array<String>) { | |
val myToday = MyDays.SUN | |
when(myToday) { | |
MyDays.SUN -> println(myToday) | |
} | |
val today = Days.SAT | |
when(today) { | |
Days.SAT -> println(Days.SAT.value) | |
} | |
} | |
enum class MyDays { | |
SUN, MON, TUE, WED, THU, FRI, SAT | |
} | |
enum class Days(val value: String) { | |
SUN("Sunday"), | |
MON("Monday"), | |
TUE("Tuesday"), | |
WED("Wednesday"), | |
THU("Thursday"), | |
FRI("FRIDAY"), | |
SAT("SATURDAY"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment