1Z0-804 · Question #31
Given: What is the result?
The correct answer is A. Three. Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it ispossible to do so immediately without violating capacity restrictions, returning true upon success and throwingan IllegalStateException if no space is currently…
Question
Given:
What is the result?
Exhibit
Options
- AThree
- BOne
- CCompilation fails.
- DThe program runs, but prints no output.
How the community answered
(26 responses)- A77% (20)
- B4% (1)
- C4% (1)
- D15% (4)
Explanation
Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it ispossible to do so immediately without violating capacity restrictions, returning true upon success and throwingan IllegalStateException if no space is currently available. This method is equivalent to addFirst(E). Pops an element from the stack represented by this deque. In other words, removes and returns the firstelement of this deque. This method is equivalent to removeFirst(). the element at the front of this deque (which is the top of the stack represented by this deque) NoSuchElementException - if this deque is empty
Topics
Community Discussion
No community discussion yet for this question.
