listing linked lists continued thestack push( )thestack push( )/push items thestack displaystack()/display stack thestack push( )thestack push( )/push items thestack displaystack()/display stack thestack pop()thestack pop()/pop items thestack displaystack()/end main(/end class linkstackapp /display stack ///////////////////////////////////////////////////////////////the main(routine creates stack objectpushes two items on itdisplays the stackpushes two more itemsand displays the stack again finallyit pops two items and displays the stack third time here' the outputstack (top-->bottom) stack (top-->bottom) stack (top-->bottom) notice the overall organization of this program the main(routine in the linkstackapp class relates only to the linkstack class the linkstack class relates only to the linklist class there' no communication between main(and the linklist class more specificallywhen statement in main(calls the push(operation in the linkstack classthis method in turn calls insertfirst(in the linklist class to actually insert data similarlypop(calls deletefirst(to delete an itemand displaystack(calls displaylist(to display the stack to the class userwriting code in main()there is no difference between using the list-based linkstack class and using the array-based stack class from the stack java program (listing in queue implemented by linked list here' similar example of an adt implemented with linked list listing shows queue implemented as double-ended linked list