fork download
  1. enum PersonType {
  2. hello("Vraj"),
  3. bye("Parth")
  4.  
  5. private var _name: String
  6.  
  7. private construct(name: String) {
  8. _name = name
  9. }
  10.  
  11. function myName() {
  12. print("My name is " + _name)
  13. }
  14. }
  15.  
  16. var tmp = PersonType.hello
  17. print(tmp.Name)
  18. print(tmp.Code)
  19. print(tmp.Ordinal)
  20. tmp.myName()
Success #stdin #stdout 3.74s 171412KB
stdin
Standard input is empty
stdout
hello
hello
0
My name is Vraj