Skip to content

Instantly share code, notes, and snippets.

@jrm2k6
Last active December 28, 2015 00:59
Show Gist options
  • Select an option

  • Save jrm2k6/7417275 to your computer and use it in GitHub Desktop.

Select an option

Save jrm2k6/7417275 to your computer and use it in GitHub Desktop.
// 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