?? seqstackapp.java
字號:
package seqStack;
import seqStack.SeqStack.FullStackException;
public class SeqStackApp
{
public static void main(String[] args)
{
System.out.println("SeqStack Demo");
System.out.println("-------------");
seqStackApp(new SeqStack(4));
}
static void seqStackApp(Stack s)
{
System.out.println("Pushing \"Hello\"");
s.push("Hello");
System.out.println("Pushing \" World\"");
s.push("World");
System.out.println("Pushing SeqStackApp Object");
s.push(new SeqStackApp());
System.out.println("Pushing Character object");
s.push("A");
System.out.println();
try
{
System.out.println("Pushing \"One last item\"");
s.push("One last item");
}catch(FullStackException e){System.out.println ("One push too many");}
System.out.println(s.getTop());
while(s.notEmpty()) System.out.println(s.pop());
try{s.pop();}catch(java.util.EmptyStackException e){System.out.println("Stack is empty!"); };
System.out.println();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -