⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stack.java

📁 java技术内幕源代码,配合书籍看有事半功倍的效果
💻 JAVA
字号:
import java.util.*;
 
class stack 
{
    public static void main(String args[]) 
    {
        Stack stack1 = new Stack();

        try {
            stack1.push(new Integer(0));
            stack1.push(new Integer(1));
            stack1.push(new Integer(2));
            stack1.push(new Integer(3));
            stack1.push(new Integer(4));
            stack1.push(new Integer(5));
            stack1.push(new Integer(6));

            System.out.println((Integer) stack1.pop());
            System.out.println((Integer) stack1.pop());
            System.out.println((Integer) stack1.pop());
            System.out.println((Integer) stack1.pop());
            System.out.println((Integer) stack1.pop());
            System.out.println((Integer) stack1.pop());
            System.out.println((Integer) stack1.pop());
        } 
        catch (EmptyStackException e) {}
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -