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 sactually 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 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 listing the linkqueue(program /linkqueue java /demonstrates queue implemented as double-ended list /to run this programc>java linkqueueapp import java io */for / ///////////////////////////////////////////////////////////////class link public double ddata/data item public link next/next link in list /public link(double /constructor ddata /public void displaylink(/display this link system out print(ddata ")//end class link ///////////////////////////////////////////////////////////////class firstlastlist private link firstprivate link last/ref to first item /ref to last item