架构之路
zhongxinhua · 共 16 篇文章
Java.util.Stack类的主要方法
java.util.Stack这个类不难,但需要注意其中的peek()方法: 查看栈顶对象而不移除它 import java.util.Date; import java.util.Stack; public class StackDemo { public static void main(String[] args) { Stack stack=new Stack(); stack.push("0"); stack.push(new Integer(1)); stack.push(2.0); stack.push(new Date()); System.out.println("stac…
2011-11-09 18:37 · 网络编程 · 评论(0) · Stack pop peek push 方法