VOOZH about

URL: https://www.geeksforgeeks.org/java/linkedblockingdeque-addall-method-in-java-with-examples/

⇱ LinkedBlockingDeque addAll() method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

LinkedBlockingDeque addAll() method in Java with Examples

Last Updated : 11 Jul, 2025

The addAll() method of LinkedBlockingDeque appends all of the elements of the specified collection to the end of this deque.
Syntax: 
 

public void addAll(Collection<E> c)


Parameters: This method accepts a mandatory parameter c which is the collection to be inserted in the end of the LinkedBlockingDeque.
Return Value: This method does not returns anything.
Exceptions: There are 2 exceptions present:- 
 

  • IllegalStateException: if the collection cannot be added at this time due to capacity restrictions.
  • NullPointerException: if the specified collection is Null.


Below program illustrates the addAll() function of LinkedBlockingDeque class:
Example1: 
 

Example 2: 
 

Comment