class stackx private int maxsizeprivate char[stackarrayprivate int top//public stackx(int /constructor maxsize sstackarray new char[maxsize]top - //public void push(char /put item on top of stack stackarray[++topj//public char pop(/take item from top of stack return stackarray[top--]//public char peek(/peek at top of stack return stackarray[top]//public boolean isempty(/true if stack is empty return (top =- )//public int size(/return size return top+ //public char peekn(int /return item at index return stackarray[ ]//public void displaystack(string ssystem out print( )system out print("stack (bottom-->top)")for(int = <size() ++system out printpeekn( )system out print(')