@@ -0,0 +1,628 @@
+package juc;%0A%0Aimport java.util.List;%0Aimport java.util.concurrent.CopyOnWriteArrayList;%0A%0A/**%0A * Created by %E6%9D%8E%E6%81%92%E5%90%8D on 2017/6/18.%0A */%0Apublic class CopyOnWriteArrayTest %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        //List%3CObject%3E list = new ArrayList%3C%3E();//java.lang.ArrayIndexOutOfBoundsException%0A       final List%3CObject%3E list = new CopyOnWriteArrayList%3C%3E();%0A        int maxThreads = 10;%0A%0A        for (int i = 0; i %3C maxThreads; i++) %7B%0A            new Thread(() -%3E %7B%0A                for (int j = 0; j %3C 100000; j++) %7B%0A                    list.add(new Object());%0A                %7D%0A            %7D).start();%0A        %7D%0A%0A    %7D%0A%7D%0A

add > juc list test code