📄 stackdemo.java
字号:
import java.util.*;
class StackDemo
{
public static void main(String[] args)
{
Stack s=new Stack();
s.push(new String("hello"));
s.push(new Double(2.2));
s.push(new Date());
Enumeration e=s.elements();
while(e.hasMoreElements())
System.out.println(e.nextElement());
System.out.println();
while(!s.empty())
System.out.println(s.pop());
System.out.println();
System.out.println("size="+s.size());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -