Skip to content

Instantly share code, notes, and snippets.

@dezgeg
Created March 20, 2012 18:02
Show Gist options
  • Save dezgeg/2138814 to your computer and use it in GitHub Desktop.
Save dezgeg/2138814 to your computer and use it in GitHub Desktop.
public class Test
{
public static String asd;
public static String bar;
public static void main(String[] args)
{
String foo = "";
for(int i = 0; i < 1000; i++)
foo += "foo";
}
}
public static void main(java.lang.String[]);
Code:
0: ldc #2; //String
2: astore_1
3: iconst_0
4: istore_2
5: iload_2
6: sipush 1000
9: if_icmpge 38
12: new #3; //class java/lang/StringBuilder
15: dup
16: invokespecial #4; //Method java/lang/StringBuilder."<init>":()V
19: aload_1
20: invokevirtual #5; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
23: ldc #6; //String foo
25: invokevirtual #5; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
28: invokevirtual #7; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
31: astore_1
32: iinc 2, 1
35: goto 5
38: return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment