return stackarray[top]//public boolean isempty(/true if stack is empty return (top =- )///end class stackx ///////////////////////////////////////////////////////////////class reverser private string inputprivate string output/input string /output string //public reverser(string in/constructor input in//public string dorev(/reverse the string int stacksize input length()/get max stack size stackx thestack new stackx(stacksize)/make stack input for(int = <input length() ++char ch input charat( )/get char from thestack push(ch)output ""while!thestack isempty(char ch thestack pop()output output chreturn output/end dorev(/push it /pop char/append to output ///end class reverser ///////////////////////////////////////////////////////////////