@Test
public void testChar(){
Queue<String> queue= new LinkedList<String>();
queue.offer("a");
queue.offer("b");
queue.offer("c");
queue.offer("d");
queue.offer("e");
System.out.println("队列中的元素是:"+queue);
queue.poll();
System.out.println("队列中的元素是:"+queue);
String peek = queue.peek();
System.out.println(peek);
System.out.println("队列中的元素是:"+queue);
Stack<String> stack=new Stack<String>();
stack.push("11");
stack.push("12");
stack.push("13");
stack.push("14");
stack.push("15");
System.out.println("栈中的元素是:"+stack);
System.out.println(stack.peek());
stack.pop();
System.out.println("pop后栈中的元素是:"+stack);
}
public void testChar(){
Queue<String> queue= new LinkedList<String>();
queue.offer("a");
queue.offer("b");
queue.offer("c");
queue.offer("d");
queue.offer("e");
System.out.println("队列中的元素是:"+queue);
queue.poll();
System.out.println("队列中的元素是:"+queue);
String peek = queue.peek();
System.out.println(peek);
System.out.println("队列中的元素是:"+queue);
Stack<String> stack=new Stack<String>();
stack.push("11");
stack.push("12");
stack.push("13");
stack.push("14");
stack.push("15");
System.out.println("栈中的元素是:"+stack);
System.out.println(stack.peek());
stack.pop();
System.out.println("pop后栈中的元素是:"+stack);
}