Created
February 12, 2020 16:08
-
-
Save shipilev/2cecfb1a44cdf0910103ad0d4319b3e5 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
$ cat Test.java | |
public class Test { | |
int t1() { | |
int i1 = 1; | |
int i2 = 1; | |
return i1 + i2; | |
} | |
int t2() { | |
final int i1 = 1; | |
final int i2 = 1; | |
return i1 + i2; | |
} | |
} | |
$ javac Test.java | |
$ javap -c -p Test.class | |
Compiled from "Test.java" | |
public class Test { | |
public Test(); | |
Code: | |
0: aload_0 | |
1: invokespecial #1 // Method java/lang/Object."<init>":()V | |
4: return | |
int t1(); | |
Code: | |
0: iconst_1 | |
1: istore_1 | |
2: iconst_1 | |
3: istore_2 | |
4: iload_1 | |
5: iload_2 | |
6: iadd | |
7: ireturn | |
int t2(); | |
Code: | |
0: iconst_2 | |
1: ireturn | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment