来自Deque的Javadoc:
While Deque implementations are not strictly required to prohibit the insertion of null elements,they are strongly encouraged to do so. Users of any Deque implementations that do allow null elements are strongly encouraged not to take advantage of the ability to insert nulls. This is so because null is used as a special return value by varIoUs methods to indicated that the deque is empty.
我在现有问题中找不到答案:Why can we add null elements to a java LinkedList?
最佳答案
原文链接:https://www.f2er.com/java/437318.html