Created
May 30, 2019 02:30
-
-
Save AhianZhang/e8796a375aa14ae791f28c24cdbdbc4e to your computer and use it in GitHub Desktop.
heap oom demo
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
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* <p>ClassName: Test</p> | |
* <p>Description: Test 类</p> | |
* <p>Company:</p> | |
* | |
* @author ahianzhang | |
* @version 1.0 | |
* @date 2019/5/30 | |
*/ | |
public class Test { | |
public static void main(String[] args) { | |
List list = new ArrayList(); | |
list.add("a"); | |
list.add("b"); | |
list.add("c"); | |
for (int i = 0; i < list.size(); i++) { | |
list.add(i,"d"); | |
System.out.println(list); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment