Vector对于add get 迭代器iterator有特有的老版用法,但是过时了,还是用新版的
基本的存储遍历跟arraylist差不多
LinkedList的特有功能
addFirst
addLast
getFirst
getLast
removeFirst
removeLast
LinkedList link=new LinkedList(); link.add("hello"); link.add("java"); link.add("lc"); link.addFirst("lc"); link.addLast("csz"); System.out.println(link); System.out.println(link.getFirst()); System.out.println(link.removeFirst()); System.out.println(link);
时间: 2024-10-12 00:52:36