Ê×Ò³ Ê«´Ê ×Öµä °å±¨ ¾ä×Ó ÃûÑÔ ÓÑ´ð ÀøÖ¾ ѧУ ÍøÕ¾µØͼ
µ±Ç°Î»ÖÃ: Ê×Ò³ > ½Ì³ÌƵµÀ > JAVA > J2SE¿ª·¢ >

Ϊʲôûȫȡ³öÀ´

2012-11-11 
Ϊɶûȫȡ³öÀ´import java.util.*public class LinkedListDemo {public static void main(String[] args

Ϊɶûȫȡ³öÀ´
import java.util.*;
 public class LinkedListDemo {
 public static void main(String[] args) {
 LinkedList<String> link =new LinkedList<String>();
 link.add("A");
 link.add("B");
 link.add("C");
 link.add("D");
 System.out.println(link.size());
 for(int i=0;i<link.size();i++)
 {
 System.out.println(link.poll());
 
 }
 System.out.println(link);
 }
 
 }
 

[½â¾ö°ì·¨]
Äã°Ñ¡°System.out.println(link.poll());¡±Ìæ»»³É¡° System.out.println(link.poll() + " size: " + link.size() + " i:" + i);¡±¿´¿´¾ÍÃ÷°×ÁË¡£¡£

ÈȵãÅÅÐÐ