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

📄 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 + -