teststack.java

来自「这是一张java应用教程的随书光盘」· Java 代码 · 共 15 行

JAVA
15
字号
import java.util.*;
class TestStack
{ public static void main(String args[])
     { Stack mystack=new Stack(); mystack.push(new String("start"));  
       mystack.push(new String("one")); mystack.push(new String("two"));
       mystack.push(new String("three")); mystack.push(new String("four"));
       mystack.push(new String("five")); mystack.push(new String("end"));       
       while(!(mystack.empty()))
         { String temp=(String)mystack.pop();
           System.out.print("  "+temp);
           }
       System.out.print("\n");
       } 
}

⌨️ 快捷键说明

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