Created
December 4, 2010 11:23
-
-
Save jrudolph/728116 to your computer and use it in GitHub Desktop.
Local variable vs. JIT test
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
*.class |
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 Test { | |
public static class T2 { | |
public T2(String str1, String str2, String str3) { | |
if (str1.length() > 12) | |
System.out.println("Hello World"); | |
} | |
} | |
public static void runner() { | |
String str1 = "test"; | |
String str2 = "test2"; | |
String str3 = "test3"; | |
new T2(str2, str3, str1); | |
} | |
public static void main(String[] args) { | |
for (int i = 0; i < 100000; i++) | |
runner(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment