What does it mean when we say an ArrayList is not synchronized?

前端 未结 6 1634

What does it mean when we say an ArrayList is not synchronized?

Does it mean that if we declare an ArrayList in object scope, multiple threads accessing the objects hav

6条回答
  •  忘掉有多难
    2021-02-07 05:59

    It means that instances of ArrayList are not guaranteed to be threadsafe. This usually includes both read and write access. If you do it without external synchronization you can leave the object in stange states and get some hard to debug behavior.

提交回复
热议问题