nerdexam
Oracle

1Z0-804 · Question #37

Given: What is the result?

The correct answer is D. onetwothree. void addFirst(E e) Inserts the specified element at the front of this deque if it is possible to do so immediately without capacity restrictions. When using a capacity-restricted deque, it is generally preferable to use method offerFirst Retrieves and removes the last element…

String Processing

Question

Given:

What is the result?

Exhibit

1Z0-804 question #37 exhibit

Options

  • AAn exception is thrown at runtime on line 9.
  • BAn exception is thrown at runtime on line 12
  • Conetwonull
  • Donetwothree
  • Etwoonenull
  • Fthreetwoone

How the community answered

(30 responses)
  • A
    3% (1)
  • C
    7% (2)
  • D
    77% (23)
  • F
    13% (4)

Explanation

void addFirst(E e) Inserts the specified element at the front of this deque if it is possible to do so immediately without capacity restrictions. When using a capacity-restricted deque, it is generally preferable to use method offerFirst Retrieves and removes the last element of this deque, or returns null if this deque is empty. the tail of this deque, or null if this deque is empty

Topics

#StringBuilder#append#null handling#string concatenation

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice