// 构造方法
List<E> list =newLinkedList<>();
List<E> list =newArrayList<>();// 增boolean success = list.add(E e);// 尾部添加元素
list.add(int index, E e);// 索引添加元素// 删boolean success = list.remove(E e);// 删除元素
E e = list.remove(int index);// 根据索引删除元素
list.clear();// 清空数组 // 改:
E e = list.set(int index, E e);// 根据索引修改元素// 查:
E e = list.get(int index);boolean isEmpty = list.isEmpty();boolean isContains = list.contains(E e);
LinkList:
// 构造方法
LinkedList<E> list =newLinkedList<>();// 增
list.addFirst(E e);
list.addLast(E e);boolean success = list.add(E e);// 等价于addLast// 删
E e = list.removeFirst();
E e = list.removeLast();
E e = list.remove();// 等价于removeFirst
E e = list.remove(int index);
list.clear();// 查
E e = list.getFirst();
E e = list.getLast();
E e = list.element();// 等价于getFirstboolean contains = list.contains(E e);int size = list.size();
HashMap&Hashtable&TreeMap
// 构造方法
HashMap<K, V> hash =newHashMap<>();
Hashtable<K, V> hash =newHashtable<>();
TreeMap<K, V> hash =newTreeMap<>();// 增、改
V value = hash.put(K key, V value);// 删
V value = hash.remove(K key);boolean success = hash.remove(K key, V value);
hash.clear();// 查
V value = hash.get(K key)boolean isContains = hash.containsKey(K key);boolean isContains = hash.containsValue(V value);boolean isEmpty = hash.isEmpty();int size= hash.size();