collection中的queue

一、Queue的类图

二、queue的相关的方法

          抛出异常       处理失败     堵塞操作 

添加头结点数据(满)      add               offer            put

拿出头结点并且删除    remove           poll(null)     take

拿出头结点但是不删除  element        peek(null)

 我们可以使用put和take用来模拟消费者-生产者模式

猜你喜欢

转载自www.cnblogs.com/fc520/p/11729540.html