In my data structures class, I learned that a
Pushes an element onto the stack represented by this list. In other words, inserts the element at the front of this list.
Pops an element from the stack represented by this list. In other words, removes and returns the first element of this list.
pop() are by convention operations related to
Deque, more specifically in this context) and that's why you should expect your
LinkedList to work that way when you use those method.
If you want your
LinkedList to work as a
Queue instead (it implements the
Queue interface) the methods you want to use (as stated in the Documentation) are