Created
January 30, 2020 05:21
-
-
Save IhwanID/cb8035c4753580e9f828c19e43b3de80 to your computer and use it in GitHub Desktop.
enum
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 characters
| void main() { | |
| printStatus(Status.Start); | |
| } | |
| enum Status{ | |
| Start, | |
| OnGoing, | |
| Finish | |
| } | |
| void printStatus(Status status){ | |
| switch(status){ | |
| case Status.Start: | |
| print("starting . . . "); | |
| break; | |
| case Status.OnGoing: | |
| print("onGoing . . . "); | |
| break; | |
| case Status.Finish: | |
| print("finish . . . "); | |
| break; | |
| } | |
| if(status == Status.Start){ | |
| print("starting . . . "); | |
| }else if(status == Status.OnGoing){ | |
| print("onGoing . . . "); | |
| }else{ | |
| print("finish . . . "); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment