offer属于 offer in interface Deque<E>,add 属于 add in interface Collection<E>。   
   当队列为空时候,使用add方法会报错,而offer方法会返回false。
   作为List使用时,一般采用add / get方法来 压入/获取对象。
   作为Queue使用时,才会采用 offer/poll/take等方法作为链表对象时,
offer等方法相对来说没有什么意义这些方法是用于支持队列应用的。

 From:

https://www.cnblogs.com/levy-li/p/6720188.html

相关文章:

  • 2021-07-08
  • 2021-12-25
  • 2021-08-20
  • 2022-12-23
  • 2022-02-06
  • 2021-11-29
猜你喜欢
  • 2021-07-12
  • 2021-11-27
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
相关资源
相似解决方案