A

Admin • 833.24K Points
Coach

Q. Which Deque method throws an exception if the element cannot be added at the front?

  • (A) offerFirst()
  • (B) addFirst()
  • (C) push()
  • (D) insertFirst()
  • Correct Answer - Option(B)
  • Views: 20
  • Filed under category Java
  • Hashtags: Java Deque

Explanation by: Admin

addFirst() throws an IllegalStateException if the Deque is capacity-restricted and full.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.