![]() |
VOOZH | about |
public Object[] toArray()Parameters:It does not take in any parameter. Return Value:It returns an array containing all the elements in the deque. Below examples illustrates the LinkedBlockingDeque.toArray() method: Example 1:
LinkedBlockingDeque: [7855642, 35658786, 5278367, 74381793] Returned Array: [7855642, 35658786, 5278367, 74381793]
public <T> T[] toArray(T[] a)Parameters: The method accepts one parameter arr[] which is the array into which the elements of the LinkedBlockingDeque are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. Return Value: The method returns an array containing the elements similar to the LinkedBlockingDeque. Exception: The method might throw two types of exception:
The LinkedBlockingDeque: [Welcome, To, Geeks, For, Geeks] Returned Array: [Welcome, To, Geeks, For, Geeks]