stacks and queues are examples of adts we've already seen that both stacks and queues can be implemented using arrays before we return to discussion of adtslet' see how stacks and queues can be implemented using linked lists this discussion will demonstrate the "abstractnature of stacks and queueshow they can be considered separately from their implementation stack implemented by linked list when we created stack in "stacks and queues,we used an ordinary java array to hold the stack' data the stack' push(and pop(operations were actually carried out by array operations such as arr[++topdataand data arr[top--]which insert data intoand take it out ofan array we can also use linked list to hold stack' data in this case the push(and pop(operations would be carried out by operations like thelist insertfirst(dataand data thelist deletefirst(the user of the stack class calls push(and pop(to insert and delete items without knowingor needing to knowwhether the stack is implemented as an array or as linked list listing shows how stack class called linkstack can be implemented using the linklist class instead of an array (object purists would argue that the name linkstack should be simply stack because users of this class shouldn' need to know that it' implemented as list listing the linkstack java program /linkstack java /demonstrates stack implemented as list /to run this programc>java linkstackapp ///////////////////////////////////////////////////////////////class link public long ddata/data item public link next/next link in list