What happens when you pop from an empty stack while implementing using the Stack ADT in Java?

Q & ACategory: Data StructureWhat happens when you pop from an empty stack while implementing using the Stack ADT in Java?
Admin Staff asked 4 years ago

What happens when you pop from an empty stack while implementing using the Stack ADT in Java?
a) Undefined error
b) Compiler displays a warning
c) EmptyStackException is thrown
d) NoStackException is thrown

1 Answers
Admin Staff answered 4 years ago

c) EmptyStackException is thrown