Created
August 31, 2019 22:08
-
-
Save jyukutyo/8960bd23d6868f7f835458a54507de87 to your computer and use it in GitHub Desktop.
Bytecode representation of numerical values
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 Temp { | |
public static void main(String[] args) { | |
System.out.println(1); | |
System.out.println(127); | |
System.out.println(1000); | |
System.out.println(10000000); | |
System.out.println(100000000000000000l); | |
System.out.println(100000000000000000d); | |
} | |
} | |
/* | |
javap -c Temp | |
public class Temp { | |
public Temp(); | |
Code: | |
0: aload_0 | |
1: invokespecial #1 // Method java/lang/Object."<init>":()V | |
4: return | |
public static void main(java.lang.String[]); | |
Code: | |
0: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; | |
3: iconst_1 | |
4: invokevirtual #13 // Method java/io/PrintStream.println:(I)V | |
7: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; | |
10: bipush 127 | |
12: invokevirtual #13 // Method java/io/PrintStream.println:(I)V | |
15: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; | |
18: sipush 1000 | |
21: invokevirtual #13 // Method java/io/PrintStream.println:(I)V | |
24: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; | |
27: ldc #19 // int 10000000 | |
29: invokevirtual #13 // Method java/io/PrintStream.println:(I)V | |
32: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; | |
35: ldc2_w #20 // long 100000000000000000l | |
38: invokevirtual #22 // Method java/io/PrintStream.println:(J)V | |
41: getstatic #7 // Field java/lang/System.out:Ljava/io/PrintStream; | |
44: ldc2_w #25 // double 1.0E17d | |
47: invokevirtual #27 // Method java/io/PrintStream.println:(D)V | |
50: return | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment