List 子类之LinkedList的增、删、获取方法

来源:互联网 发布:剑网南风捏脸米苏数据 编辑:程序博客网 时间:2024/06/05 14:28
   
jdk1.6版本以前jdk1.6后      addFirst();
      addLast():
    offerFirst();
    offerLast();
 getFirst();.//获取但不移除,如果链表为空,NoSuchElementException.
 getLast();
    peekFirst();//获取但不移除,如果链表为空,返回null.
    peekLast():
  removeFirst();//获取并移除,如果链表为空,NoSuchElementException.
  removeLast();
    pollFirst();//获取并移除,如果链表为空,返回null.
    pollLast();

   
0 0
原创粉丝点击