BlockingQueue
是一个扩展 Queue 接口的接口。它在检索、插入、删除等操作中提供并发性。在检索任何元素时,它会等待队列非空。在存储元素时,它会等待可用空间。BlockingQueue
不能包含 null
元素,BlockingQueue 的实现是线程安全的。
语法:
public interface BlockingQueue<E> extends Queue <E>
315、BlockingQueue是什么?
BlockingQueue
是一个扩展 Queue 接口的接口。它在检索、插入、删除等操作中提供并发性。在检索任何元素时,它会等待队列非空。在存储元素时,它会等待可用空间。BlockingQueue
不能包含 null
元素,BlockingQueue 的实现是线程安全的。
语法:
public interface BlockingQueue<E> extends Queue <E>