Last active
December 28, 2015 00:59
-
-
Save jrm2k6/7417275 to your computer and use it in GitHub Desktop.
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
| // http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html | |
| switch(a) { | |
| case 0: | |
| doSomething(); | |
| break; | |
| case 1: | |
| doSomethingElse(); | |
| break; | |
| case 2: | |
| andSoOn(); | |
| break; | |
| default: | |
| doSomethingDefaultOrNot(); | |
| break; | |
| } | |
| // another version | |
| public String[] methods = {"methodBlowMe", "methodBlowMeAgain", "methodBlowStill"...}; | |
| public String[] foldersTemplates = {"templates1", "templates2", "templates3"...}; | |
| // list are 0-base indexed in java, methods[0] te donne le premier element du tableau, ici "methodBlowMe" | |
| String methodChosen = methods[a-1]; | |
| String folderTemplate = foldersTemplates[a-1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment