Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Java source code:
- public class Test {
- public static void main(String[] d) {
- String str = "Hello";
- for (int i = 0; i < str.length(); i++);
- }
- }
- compiles to:
- public static void main(java.lang.String[]);
- Code:
- 0: ldc #2 // String Hello
- 2: astore_1 // slot 1 is reference to "Hello"
- 3: iconst_0
- 4: istore_2 // does i=0
- 5: iload_2 // get i
- 6: aload_1 // get "Hello"
- 7: invokevirtual #3 // Method java/lang/String.length:()I
- 10: if_icmpge 19 // compare i with length
- 13: iinc 2, 1 // i++
- 16: goto 5 // loop back
- 19: return
- LineNumberTable:
- line 7: 0
- line 8: 3
- line 12: 19
- LocalVariableTable:
- Start Length Slot Name Signature
- 5 14 2 i I
- 0 20 0 d [Ljava/lang/String;
- 3 17 1 str Ljava/lang/String;
Advertisement
Add Comment
Please, Sign In to add comment