Skip to content

Collections. SynchronizedList ()、CopyOnWriteArrayList 与 Vector 有什么区别? - 冰淇淋流泪|博客 #5

Description

@icecreamZeng

https://www.zenghao.xyz/2021/11/22/Collections.%20SynchronizedList%20()%E3%80%81CopyOnWriteArrayList%20%E4%B8%8E%20Vector%20%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB%EF%BC%9F/

Collections. SynchronizedList () 、 CopyOnWriteArrayList 和 Vector 都是线程安全的集合。 Vector Vector 的同步做法是给所有公有方法都加上 “Synchronized”[^1] 关键字。 12345678//Vectorpublic synchronized boolean add(E e) { mo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions