Last active
May 15, 2021 21:14
-
-
Save Sangdol/3388251 to your computer and use it in GitHub Desktop.
If and Switch statement for bytecode compare
This file contains 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
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