offer
public boolean offer(E e)
Adds the specified element as the tail (last element) of this list.
-
Specified by:
-
offer
in interfaceDeque<E>
Specified by:
-
offer
in interfaceQueue<E>
Parameters:
-
e
- the element to add
Returns:
-
add
in interfaceCollection<E>
Specified by:
-
add
in interfaceDeque<E>
Specified by:
-
add
in interfaceList<E>
Specified by:
-
add
in interfaceQueue<E>
Overrides:
-
add
in classAbstractList<E>
Parameters:
-
e
- element to be appended to this list
Returns:
-
true
(as specified byCollection.add(E)
)
true
(as specified by Queue.offer(E)
)
add
public boolean add(E e)
Appends the specified element to the end of this list.
This method is equivalent to addLast(E)
.
-
Specified by:
参考:https://docs.oracle.com/javase/7/docs/api/