A

Admin • 828.70K Points
Coach

Q. What is the primary difference between offerFirst() and addFirst() in Deque?

  • (A) addFirst() is slower
  • (B) offerFirst() throws exception when full
  • (C) addFirst() throws exception, offerFirst() returns false
  • (D) offerFirst() adds to tail
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Deque

Explanation by: Admin
addFirst() throws an exception if full, while offerFirst() returns false.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.