how to create Synchronized arraylist

前端 未结 7 1452
轻奢々
轻奢々 2020-12-15 07:50

i have created synchronized arrayList like this

import java.text.SimpleDateFormat;
import java.util.*;


class HelloThread  
{

 int i=1;
 List arrayList;
           


        
相关标签:
7条回答
  • 2020-12-15 08:45

    You may not modify a Collection that you are iterating. You can work around this by accessing the array entries by index, not through an Iterator. I can provide more advice if you tell me the problem that you are trying to solve with this code.

    0 讨论(0)
提交回复
热议问题