Skip to content

Instantly share code, notes, and snippets.

@Sangdol
Last active May 15, 2021 21:14
Show Gist options
  • Save Sangdol/3388251 to your computer and use it in GitHub Desktop.
Save Sangdol/3388251 to your computer and use it in GitHub Desktop.
If and Switch statement for bytecode compare
public class IfAndSwitch {
public static void ifFunc(int v) {
if (v == 1) {
System.out.println(1);
} else if (v == 2) {
System.out.println(2);
}
}
public static void switchFunc(int v) {
switch (v) {
case 1:
System.out.println(1);
break;
case 2:
System.out.println(2);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment