package arrayStack1; import java.util.Scanner; /* * { * This is comment. [ */ // compile java { // comment /* * */ String s = "Hello"; char c = '<'; d = '\n'; k = '\''; final String OPENING_PAREN = "([{"; final String CLOSING_PAREN = ")]}"; class ArrayStack implements Stack { private T[] items; private int size = 0; private int maxSize = 3; public T pop() { if (isEmpty()) throw new java.util.EmptyStackException(); T item = items[--size]; items[size] = null; return item; } /** ¤·¤©¤·¤¤¤©¤·¤¤ ¤©¤·¤¤¸Ó¸®¤¿¾ó ¤Ó¤¿¾î¸® ¤¿¤· */ } public class TestStack1 { public static void main(String[] args) { ArrayStack stack = new ArrayStack(); while (!command.equals("q")) { if (command.equals("push")) { item = input.nextInt(); stack.push(item); } else if (command.equals("p")) // stack.print(); System.out.println(stack); System.out.print("> "); command = input.next(); } } }