What is a `Stack` in Java?
A `Stack` is an ordered collection where elements are accessed randomly. It allows inserting and removing elements from both ends.
That's incorrect. A `Stack` is a LIFO structure, and elements are removed only from the top, not both ends.
Can you explain how elements are pushed and popped from a `Stack`?