These two classic data structures have simple and clean behaviors that make them a good topic for a starting point in discussing data structures. Stacks and Queues both act as a container of elements with well defined methods that enter elements into them or take elements away. There are numerous application for either of these data structures. A queue allows us to process these print requests in order. An example of where a stack is useful is in implementation of a preemption mechanism for resources.
Lets consider a single cpu system with multiple processes competing for access to cpu.
Often we assign priority to these requests. Suppose that a new process comes along with priority 2, it preempts the first process by taking over the cpu, but the system can't throw away the first process, so it is put on a stack. The one with the highest priority will be at the top and it is the one we take off and resume processing of since the data structure is a stack. There are variety of implementations for stacks and queues. For a queue, we can define an array and put each element that comes in in the next available spot.