public class OurStack4 { char[] letters; int top; public OurStack4 () { letters = new char [100]; top = 0; } public void push (char ch) { letters[top] = ch; top ++; } public char pop () throws OurStackException { if (top > 0) { top --; return letters[top]; } else { // Error: throw an exception throw new OurStackException (); // Don't need this: return '@'; } } public boolean isEmpty () { if (top == 0) { return true; } else { return false; } // Alt: return (top==0? true: false); } }