首页 > 代码库 > LinkedList类

LinkedList类

 

/*
* LinkedList的特有功能
*
* A:添加功能
* public void addFirst(Object e);
* public void addLast(Object e);
*
* B:特有功能
* public Object getFirst();
* public Object getLast();
*
* C:删除功能
* public Object removeFirst();
* public Object removeLast();
* */

 

import java.util.LinkedList;

/*
 * LinkedList的特有功能
 * 
 * A:添加功能
 * public void addFirst(Object e);
 * public void addLast(Object e);
 * 
 * B:特有功能
 * public Object getFirst();
 * public Object getLast();
 * 
 * C:删除功能
 * public Object removeFirst();
 * public Object removeLast();
 * */

public class IntegerDemo {
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		LinkedList link = new LinkedList();

		link.add("hello");
		link.add("world");
		link.add("java");

		link.addFirst("javaee");
		link.addLast("android");

		System.out.println("link:" + link);
	}
}

 

LinkedList类