1. 程式人生 > >LinkedBlockingQueue的put,add跟offer的區別

LinkedBlockingQueue的put,add跟offer的區別

Inserts the specified element at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, returning true upon success and falseifthis queue is full. When using a capacity-restricted queue, this method is generally preferable to method add, which can fail to insert an element only by throwing an exception.