//public boolean isfull(/true if stack is full return (top =maxsize- )///end class stackx ///////////////////////////////////////////////////////////////class stackapp public static void main(string[argsstackx thestack new stackx( )/make new stack thestack push( )/push items onto stack thestack push( )thestack push( )thestack push( )stack while!thestack isempty(/until it' empty/delete item from double value thestack pop()system out print(value)/display it system out print(")/end while system out println("")/end main(/end class stackapp the main(method in the stackapp class creates stack that can hold itemspushes items onto the stackand then displays all the items by popping them off the stack until it' empty here' the output notice how the order of the data is reversed because the last item pushed is the first one poppedthe appears first in the output this version of the stackx class holds data elements of type double as noted in the last you can change this to any other typeincluding object types stackx class methods the constructor creates new stack of size specified in its argument the fields of the stack comprise variable to hold its maximum size (the size of the array)the array itselfand variable topwhich stores the index of the item on the top of the stack (note that