(String[] args)
| 24 | return (top == maxSize - 1); |
| 25 | } |
| 26 | public static void main(String[] args) { |
| 27 | MyStack theStack = new MyStack(10); |
| 28 | theStack.push(10); |
| 29 | theStack.push(20); |
| 30 | theStack.push(30); |
| 31 | theStack.push(40); |
| 32 | theStack.push(50); |
| 33 | |
| 34 | while (!theStack.isEmpty()) { |
| 35 | long value = theStack.pop(); |
| 36 | System.out.print(value); |
| 37 | System.out.print(" "); |
| 38 | } |
| 39 | System.out.println(""); |
| 40 | } |
| 41 | } |