Is Java ArrayList / String / atomic variable reading thread safe?

前端 未结 6 1948
南方客
南方客 2021-02-14 00:27

I\'ve been mulling this over & reading but can find an absolute authoritative answer.

I have several deep data structures made up of objects containing ArrayLists, S

6条回答
  •  面向向阳花
    2021-02-14 01:13

    Just as an addendum to everyone else's answers: if you're sure you need to synchronize your array lists, you can call Collections.synchronizedList(myList) which will return you a thread safe implementation.

提交回复
热议问题