Inserts the specified element at the front of this deque unless it would violate capacity restrictions. When using a capacity-restricted deque, this method is generally preferable to the addFirst(E) method, which can fail to insert an element only by throwing an exception.
在不违反容量限制的情况下,将指定的元素插入此双端队列的末尾。当使用有容量限制的双端队列时,此方法通常优于 addLast(E) 方法,后者可能无法插入元素,而只是抛出一个异常。 |