nerdexam
Oracle

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…

Java Class Design

Question

Given:

What is the result?

Exhibit

1Z0-804 question #31 exhibit

Options

  • AThree
  • BOne
  • CCompilation fails.
  • DThe program runs, but prints no output.

How the community answered

(26 responses)
  • A
    77% (20)
  • B
    4% (1)
  • C
    4% (1)
  • D
    15% (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

#enum#switch statement#control flow#class design

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice