Skip to content

Instantly share code, notes, and snippets.

@myanmarlinks
Created July 8, 2019 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myanmarlinks/efe7221334f25121af4439afe3a29c90 to your computer and use it in GitHub Desktop.
Save myanmarlinks/efe7221334f25121af4439afe3a29c90 to your computer and use it in GitHub Desktop.
Bridge to Kotlin Part 8
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