iManage Interview Question

How does a stack in Java work?