List 集合类家族介绍

  1. ArrayList

    transient Object[] elementData;

  2. LinkedList

    private static class Node<E> {
        E item;
        Node<E> next;
        Node<E> prev;
    
        Node(Node<E> prev, E element, Node<E> next) {
            this.item = element;
            this.next = next;
            this.prev = prev;
        }
    }
    
  3. Vector

    Vector 内部方法加了同步关键字(synchronized),所以是线程安全的
    与ArrayList 类似,内部也是一个Object数字

  4. Stack

    继承自Vector ,实现栈了后进先出的属性。

posted @ 2024-01-29 13:47  jackluooo  阅读(12)  评论(0)    收藏  举报