LinkedBlockingDeque hashCode() method in Java with Example Last Updated : 24 Dec, 2018 Comments Improve Suggest changes Like Article Like Report The hashCode() method of LinkedBlockingDeque in Java is used to get the hashCode value for this instance of the LinkedBlockingDeque. It returns an integer value which is the hashCode value for this instance of the LinkedBlockingDeque. Syntax: public int hashCode() Parameters: This function has no parameters. Returns: The method returns an integer value which is the hashCode value for this instance of the LinkedBlockingDeque. Below examples illustrates the LinkedBlockingDeque.hashCode() method: Program 1: Java // Java Program Demonstrate hashCode() // method of LinkedBlockingDeque import java.util.concurrent.LinkedBlockingDeque; import java.util.*; public class GFG { public static void main(String[] args) throws IllegalStateException { // create object of LinkedBlockingDeque LinkedBlockingDeque<Integer> LBD = new LinkedBlockingDeque<Integer>(); // Add numbers to end of LinkedBlockingDeque LBD.add(7855642); LBD.add(35658786); LBD.add(5278367); LBD.add(74381793); System.out.println("Linked Blocking Deque: " + LBD); // Get the hashCode value // using hashCode() value System.out.println("HashCode value: " + LBD.hashCode()); } } Output: Linked Blocking Deque: [7855642, 35658786, 5278367, 74381793] HashCode value: 2101973421 Program 2: Java // Java Program Demonstrate hashCode() // method of LinkedBlockingDeque // when the list contains characters import java.util.concurrent.LinkedBlockingDeque; import java.util.*; public class GFG { public static void main(String[] args) throws IllegalStateException { // create object of LinkedBlockingDeque LinkedBlockingDeque<String> LBD = new LinkedBlockingDeque<String>(); // Add numbers to end of LinkedBlockingDeque LBD.add("1"); LBD.add("2"); LBD.add("3"); LBD.add("4"); System.out.println("Linked Blocking Deque: " + LBD); // Get the hashCode value // using hashCode() value System.out.println("HashCode value: " + LBD.hashCode()); } } Output: Linked Blocking Deque: [1, 2, 3, 4] HashCode value: 2101973421 Comment More infoAdvertise with us Next Article LinkedBlockingDeque hashCode() method in Java with Example C code_r Follow Improve Article Tags : Java Java-Collections Java - util package Java-Functions Java-LinkedBlockingDeque +1 More Practice Tags : JavaJava-Collections Similar Reads LinkedBlockingDeque size() method in Java The size() method of LinkedBlockingDeque returns the current size of the Deque container. On calling the function the number of elements in the Deque container is returned. If the container is capacity restricted, then also it returns the number of elements which are present in the container at the 2 min read LinkedBlockingDeque spliterator() method in Java The spliterator() method of LinkedBlockingDeque returns a Spliterator on the elements of LinkedBlockingDeque. The returned iterator is weakly consistent. Spliterator can be used with Streams in Java 8. Spliterator can traverse elements individually and in bulk too. Syntax: public Spliterator spliter 2 min read LinkedBlockingDeque removeFirstOccurrence() method in Java The removeFirstOccurrence() method of LinkedBlockingDeque removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it remains unchanged. It returns true if this deque contained the specified element, else it returns false. Syntax: public boole 2 min read LinkedBlockingDeque takeLast() method in Java The takeLast() method of LinkedBlockingDeque returns and removes the tail of the Deque container from it. The method throws an InterruptedException if it is interrupted while waiting. Syntax: public E takeLast() Returns: This method returns the tail(last element) of the Deque container. Exception: T 2 min read LinkedBlockingDeque take() method in Java The take() method of LinkedBlockingDeque returns and removes the head of the Deque container from it. The method throws an InterruptedException if it is interrupted while waiting. Syntax: public E take() Returns: This method returns the head of the Deque container. Exception: The function throws a I 2 min read LinkedBlockingDeque removeLastOccurrence() method in Java The removeLastOccurrence() method of LinkedBlockingDeque removes the last occurrence of the specified element from this deque. If the deque does not contain the element, it remains unchanged. It returns true if this deque contained the specified element, else it returns false. Syntax: public boolean 2 min read LinkedBlockingDeque takeFirst() method in Java The takeFirst() method of LinkedBlockingDeque returns and removes the first element of the Deque container from it, waiting if necessary until an element becomes available.. The method throws an InterruptedException if it is interrupted while waiting. Syntax: public E takeFirst() Returns: This metho 2 min read LinkedBlockingDeque putLast() method in Java The putLast(E e) method of LinkedBlockingDeque inserts the specified element into the queue represented by this deque (in other words, at the tail/end of this deque). If the Deque is capacity restricted, then it will wait for the space to become available. Syntax: public void putLast(E e) Parameters 2 min read LinkedBlockingDeque toString() method in Java The toString() method of LinkedBlockingDeque returns a string representation of this collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). The adjacent elements are separated by the ch 2 min read LinkedBlockingDeque toArray() method in Java with Example toArray() The Java.util.concurrent.LinkedBlockingDeque.toArray() method returns an array containing all the elements in the deque in proper sequence i.e. from first to last. The returned array will be safe as a new array is created (hence new memory is allocated). Thus the caller is free to modify t 3 min read Like