B和D是线程安全的类。ArrayList的初始代码为:/***Constructsanemptylistwithaninitialcapacityoften.*/publicArrayList(){this(10);}定义了一个容量为10,size为0的列表。