Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test
- {
- public static void main(String[] args)
- {
- int x; // declare x
- int y=4; // declare and assign y
- y++; // change y
- String s; // declare s
- }
- }
- walter@walter-s5-1030uk:~/Documents$ javap -c -l Test.class
- Compiled from "Test.java"
- class Test {
- Test(); // //////////// compiler-written constructor - ignore
- Code:
- 0: aload_0
- 1: invokespecial #1 // Method java/lang/Object."<init>":()V
- 4: return
- LineNumberTable:
- line 1: 0
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 5 0 this LTest; // end constructor ///////////////////////
- public static void main(java.lang.String[]);
- Code: // bytecode of main starts here
- 0: iconst_4 // get 4
- 1: istore_2 // store in 2 - so y=4
- 2: iinc 2, 1 // increment value at 2 - so y++
- 5: return // the end
- LineNumberTable:
- line 6: 0
- line 7: 2
- line 9: 5
- LocalVariableTable: // teh local variables and parameter
- Start Length Slot Name Signature
- 0 6 0 args [Ljava/lang/String; // String[] args
- 2 4 2 y I // y, an int, starts at 2, 4 bytes long
- }
Advertisement
Add Comment
Please, Sign In to add comment