stevennathaniel

Kotlin : Conditionals and Flow Control

Jan 27th, 2017
147
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. enum class Enemies{Orc, Skeleton, Pigeon}
  2.  
  3. fun main(args: Array<String>) {
  4.  
  5.     var enemy = Enemies.Orc
  6.  
  7.     println("Enemy was of type " + if (enemy == Enemies.Orc) {
  8.  
  9.         // Do Orc related code
  10.  
  11.         "Orc"
  12.  
  13.     } else {
  14.  
  15.         "Not Orc"
  16.     })
  17.  
  18. }
RAW Paste Data