title: How memory is allocated for Stack and Queue in java
body: <p>We know ArrayList uses dynamic array to store data. LinkedList uses linked list to store data. So, for both these case we know how it works when there is a new element added or deleted(Memory wise). Now similarly, how memory is allocated for a Stack or Queue in java. What happens, at Memory level, when I add/delete element to/from Stack or Queue.</p>