A

Admin • 833.24K Points
Coach

Q. Which method in Deque returns but does not remove the first element?

  • (A) peekFirst()
  • (B) pop()
  • (C) pollFirst()
  • (D) getFirst()
  • Correct Answer - Option(A)
  • Views: 32
  • Filed under category Java
  • Hashtags: Java Deque

Explanation by: Admin

peekFirst() returns the first element without removing it or returns null if empty.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.