Java 中的 LinkedList
以下取自http://download.oracle.com/javase/6/docs/api/index.html?java/util/LinkedList.html
import java.util.*;
public class testLinkedList {
public static void main(String[] args) {
String arr[]={"JAVA", "API", "好用"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.addFirst(x);
System.out.println(list);
int x=list.indexOf("JAVA");
if (x!=-1)
list.add(x,"誰說的");
System.out.println(list);
list.remove();
System.out.println(list);
Object brr[]=list.toArray();
for (Object y: brr)
System.out.println(y);
}
}
herrDeng網內搜尋

自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
-
需要練習的Java程式:
-
Ex1 加權平均
-
請用Java顯示以下字串:
-
計算gcd(123456789,999999999)
沒有留言:
張貼留言