Title: Java Queue Example (with video) - Java Code Geeks
Open Graph Title: Java Queue Example (with video) - Java Code Geeks
Description: Check out our detailed example about Java Queue and Priority queue in Java, where we can keep and handle elements before processing.
Open Graph Description: Check out our detailed example about Java Queue and Priority queue in Java, where we can keep and handle elements before processing.
Mail addresses
support@javacodegeeks.com
Opengraph URL: https://examples.javacodegeeks.com/java-queue-example/
Generator: WordPress 6.9.4
Domain: examples.javacodegeeks.com
{"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://examples.javacodegeeks.com/java-queue-example/#article","isPartOf":{"@id":"https://examples.javacodegeeks.com/java-queue-example/"},"author":{"name":"Abhinav Nath Gupta","@id":"https://examples.javacodegeeks.com/#/schema/person/b7184a4af6c089e20a78d852b31f3cd3"},"headline":"Java Queue Example (with video)","datePublished":"2014-04-08T07:57:58+00:00","dateModified":"2022-07-06T12:38:02+00:00","mainEntityOfPage":{"@id":"https://examples.javacodegeeks.com/java-queue-example/"},"wordCount":1675,"commentCount":0,"publisher":{"@id":"https://examples.javacodegeeks.com/#organization"},"image":{"@id":"https://examples.javacodegeeks.com/java-queue-example/#primaryimage"},"thumbnailUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","articleSection":["Queue"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https://examples.javacodegeeks.com/java-queue-example/#respond"]}]},{"@type":"WebPage","@id":"https://examples.javacodegeeks.com/java-queue-example/","url":"https://examples.javacodegeeks.com/java-queue-example/","name":"Java Queue Example (with video) - Java Code Geeks","isPartOf":{"@id":"https://examples.javacodegeeks.com/#website"},"primaryImageOfPage":{"@id":"https://examples.javacodegeeks.com/java-queue-example/#primaryimage"},"image":{"@id":"https://examples.javacodegeeks.com/java-queue-example/#primaryimage"},"thumbnailUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","datePublished":"2014-04-08T07:57:58+00:00","dateModified":"2022-07-06T12:38:02+00:00","description":"Check out our detailed example about Java Queue and Priority queue in Java, where we can keep and handle elements before processing.","breadcrumb":{"@id":"https://examples.javacodegeeks.com/java-queue-example/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https://examples.javacodegeeks.com/java-queue-example/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https://examples.javacodegeeks.com/java-queue-example/#primaryimage","url":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","contentUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https://examples.javacodegeeks.com/java-queue-example/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://examples.javacodegeeks.com/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https://examples.javacodegeeks.com/category/java-development/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https://examples.javacodegeeks.com/category/java-development/core-java/"},{"@type":"ListItem","position":4,"name":"util","item":"https://examples.javacodegeeks.com/category/java-development/core-java/util/"},{"@type":"ListItem","position":5,"name":"Queue","item":"https://examples.javacodegeeks.com/category/java-development/core-java/util/queue/"},{"@type":"ListItem","position":6,"name":"Java Queue Example (with video)"}]},{"@type":"WebSite","@id":"https://examples.javacodegeeks.com/#website","url":"https://examples.javacodegeeks.com/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https://examples.javacodegeeks.com/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://examples.javacodegeeks.com/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https://examples.javacodegeeks.com/#organization","name":"Exelixis Media P.C.","url":"https://examples.javacodegeeks.com/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://examples.javacodegeeks.com/#/schema/logo/image/","url":"https://examples.javacodegeeks.com/wp-content/uploads/2022/06/exelixis-logo.png","contentUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2022/06/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https://examples.javacodegeeks.com/#/schema/logo/image/"},"sameAs":["https://www.facebook.com/javacodegeeks","https://x.com/javacodegeeks"]},{"@type":"Person","@id":"https://examples.javacodegeeks.com/#/schema/person/b7184a4af6c089e20a78d852b31f3cd3","name":"Abhinav Nath Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://examples.javacodegeeks.com/#/schema/person/image/","url":"https://secure.gravatar.com/avatar/6b3345fff21b7b5e75867ede01e0db109dd33d3fe0443f6e0a32be030bd0be14?s=96&d=mm&r=g","contentUrl":"https://secure.gravatar.com/avatar/6b3345fff21b7b5e75867ede01e0db109dd33d3fe0443f6e0a32be030bd0be14?s=96&d=mm&r=g","caption":"Abhinav Nath Gupta"},"description":"Abhinav holds a Master degree in Computer Science and Engineering from the National Institute of Technology Karnataka. He has finished his graduation from Information Technology Department in the Anand Engineering College, Agra. During his studies he has been involved with a large number of projects ranging from Networking and Cryptography. He works as a software development engineer at a software development firm in bengaluru where he is mainly involved with projects based on Nodejs. He is interested in cryptography, data security, cryptocurrency and cloud computing, and published articles regarding these topics. He can be reached at abhi.aec89@gmail.com.","sameAs":["https://www.facebook.com/ang1989","https://in.linkedin.com/in/abhinav-gupta-2aab7113","https://x.com/abhiit89"],"url":"https://examples.javacodegeeks.com/author/abhinav_nath-gupta/"}]}
{"@context":"http:\/\/schema.org","@type":"BreadcrumbList","@id":"#Breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"name":"Home","@id":"https:\/\/examples.javacodegeeks.com\/"}},{"@type":"ListItem","position":2,"item":{"name":"Java Development","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"}},{"@type":"ListItem","position":3,"item":{"name":"Core Java","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"}},{"@type":"ListItem","position":4,"item":{"name":"util","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/util\/"}},{"@type":"ListItem","position":5,"item":{"name":"Queue","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/util\/queue\/"}}]}
{"@context":"http:\/\/schema.org","@type":"Article","dateCreated":"2014-04-08T10:57:58+03:00","datePublished":"2014-04-08T10:57:58+03:00","dateModified":"2022-07-06T15:38:02+03:00","headline":"Java Queue Example (with video)","name":"Java Queue Example (with video)","keywords":[],"url":"https:\/\/examples.javacodegeeks.com\/java-queue-example\/","description":"In this article, we feature a comprehensive Java Queue Example and we explain what a Priority Queue in Java is. With the Java Queue, we can keep and handle elements before processing. Except for the m","copyrightYear":"2014","articleSection":"Queue","articleBody":"\nIn this article, we feature a comprehensive Java Queue Example and we explain what a Priority Queue in Java is. With the Java Queue, we can keep and handle elements before processing. Except for the methods that Collection provides, it also supports some basic operations in order to simulate the classic queue structure. Each of these operations exists in two forms:\n\n\n\nif a method fails, an exception is thrown. This form includes add(), remove() and element() methods.if a method fails, a special value is returned (null or false). This form contains offer(), poll() and peek() operations.\n\n\n\nYou can also check this tutorial in the following video:\n\n\n\nJava Queue Example - Video\n\n\n\nIt is worth to mention that FIFO (first-in-first-out) is the most common way to order the elements in the Java Queue. In order to visualize the structure of the Queue please consider the snapshot below,\n\n\n\nQueue Data Structure\n\n\n\nThe above snapshot shows that the queue is merely acting as a buffer which can be filled from one end, with operation enqueue, and emptied from the other end, with operation dequeue.\n\n\n\nQueue data structure implementation comes baked in Java Collections Framework, the following diagram shows the place of the Queue implementation class within the hierarchy of the java collections framework.\n\n\n\nUML Diagram for Queue Data Structure\n\n\n\nIn the following section, we are going to show the operations to manage a queue.\n\n\n\n1. Explanation of Queue operations\n\n\n\nFirst of all, let's see analytically the basic operations that exist in two different forms.\n\n\n\n1.1. Throws exception\n\n\n\nadd(E e): inserts the element e to the tail of the queue. If there is no space available because of capacity restrictions, IllegalStateException is thrown.remove(): removes and returns the head (the first element) of the queue. If the queue is empty, NoSuchElementException is thrown.element(): just returns the head of the queue, without removing it. If the queue is empty, again NoSuchElementException is thrown.\n\n\n\n1.2. Returns special value\n\n\n\noffer(E e): adds the element e to the tail of the queue. If the insertion is successful the method returns true, otherwise, it returns false. Generally, if there are capacity bounds, it is preferred to use add method instead.poll(): like remove() function, it retrieves and removes the head of the queue. The only difference from remove() is that poll() operation returns null when the queue is empty.peek(): just like element() operation it retrieves and returns the head of the queue, without removing it. In this situation when the queue is empty, it returns null.\n\n\n\n2. Queue\u2019s Interfaces\n\n\n\nThe Queue interface does not define the blocking queue methods, which are common in concurrent programming. These methods, which wait for elements to appear or for space to become available, are defined in the BlockingQueue interface, which extends this interface\n\n\n\nDeque: abstracts a queue that has two heads. A deque allows adding or removing elements at both ends.BlockingQueue: abstracts a type of queues that waits for the queue to be non-empty when retrieving an element, and waits for space to become available in the queue when storing an element.BlockingDeque: is similar to BlockingQueue, but for double-ended queues. It is a sub-interface of the BlockingQueue.TransferQueue is a specialized BlockingQueue, in which producers can wait for consumers to receive elements.\n\n\n\n3. Queue\u2019s Implementations\n\n\n\nQueue implementations generally do not allow insertion of null elements, although some implementations, such as LinkedList, do not prohibit insertion of null. Even in the implementations that permit it, null should not be inserted into a Queue, as null is also used as a special return value by the poll method to indicate that the queue contains no elements.\n\n\n\nQueue implementations generally do not define element-based versions of methods equals and hashCode but instead inherit the identity-based versions from class Object, because element-based equality is not always well-defined for queues with the same elements but different ordering properties.\n\n\n\n3.1. General-purpose Queue implementations:\n\n\n\nLinkedList: this class implements both List and Deque interface, thus having hybrid characteristics and behaviors of list and queue. Consider using a LinkedList when you want fast adding and fast removing elements at both ends, plus accessing elements by index.PriorityQueue: the priority queue in Java orders elements according to their natural ordering, or by a Comparator provided at construction time. Consider using a Priority Queue when you want to take advantage of natural ordering and fast adding elements to the tail and fast removing elements at the head of the queue in Java program.AbstractQueue: This class provides skeletal implementations of some Queue operations. The implementations in this class are appropriate when the base implementation does not allow null elements. Methods add, remove, and element are based on offer, poll, and peek, respectively, but throw exceptions instead of indicating failure via false or null returns. \n\n\n\n3.2. Concurrent Queue implementations:\n\n\n\nLinkedBlockingQueue: an optionally bounded FIFO blocking queue backed by linked nodesArrayBlockingQueue: a bounded FIFO blocking queue backed by an arrayPriorityBlockingQueue: an unbounded blocking priority queue backed by a heap in a Java programDelayQueue: a time-based scheduling queue backed by a heapSynchronousQueue: a simple rendezvous mechanism that uses the BlockingQueue interfaceLinkedTransferQueue: an unbounded TransferQueue based on linked nodesConcurrentLinkedQueue: An unbounded thread-safe queue based on linked nodes.\n\n\n\n4. Deque\u2019s Implementations\n\n\n\nThe Deque interface, pronounced as \"deck\", represents a double-ended queue. The Deque interface can be implemented as various types of Collections. The Deque interface implementations are grouped into general-purpose and concurrent implementations.\n\n\n\n4.1 General-purpose Queue implementations:\n\n\n\nArrayDeque: a simple implementation of the Deque interface. Consider using an ArrayDeque when you want to utilize features of a double ended queue without list-based ones (simpler than a LinkedList).LinkedList: Implements all optional list operations, and permits all elements (including null).\n\n\n\n4.2 Concurrent Queue implementations:\n\n\n\nLinkedBlockingDeque: is the concurrent implementation of the Deque interface.ConcurrentLinkedDeque: An unbounded concurrent deque based on linked nodes.\n\n\n\nWhile Deque implementations are not strictly required to prohibit the insertion of null elements, they are strongly encouraged to do so. Users of any Deque implementations that do allow null elements are strongly encouraged not to take advantage of the ability to insert nulls. This is so because null is used as a special return value by various methods to indicate that the deque is empty.\n\n\n\nDeque implementations generally do not define element-based versions of the equals and hashCode methods, but instead inherit the identity-based versions from class Object.\n\n\n\n5. Example of Java Queue\n\n\n\nNow, we are going to show in the code how to use the operations we explained above. So, create a new java file with the name QueueClass and paste the following code.\n\n\n\nQueueClass.java\n\n\n\n\n\n\n\n\n\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n\n\n\npackage com.javacodegeeks.core.queue;\n \nimport java.util.LinkedList;\nimport java.util.NoSuchElementException;\nimport java.util.Queue;\n \npublic class QueueClass {\n \n public static void main(String[] args) {\n \n Queue myQueue = new LinkedList(); \n \n \/\/ add elements in the queue using offer() - return true\/false\n myQueue.offer(\"Monday\");\n myQueue.offer(\"Thursday\");\n boolean flag = myQueue.offer(\"Wednesday\");\n \n System.out.println(\"Wednesday inserted successfully? \"+flag);\n \n \/\/ add more elements using add() - throws IllegalStateException\n try {\n myQueue.add(\"Thursday\");\n myQueue.add(\"Friday\");\n myQueue.add(\"Weekend\");\n } catch (IllegalStateException e) {\n e.printStackTrace();\n }\n \n System.out.println(\"Pick the head of the queue: \" + myQueue.peek());\n \n String head = null;\n try {\n \/\/ remove head - remove()\n head = myQueue.remove();\n System.out.print(\"1) Push out \" + head + \" from the queue \"); \n System.out.println(\"and the new head is now: \"+myQueue.element());\n } catch (NoSuchElementException e) {\n e.printStackTrace();\n }\n \n \/\/ remove the head - poll()\n head = myQueue.poll();\n System.out.print(\"2) Push out \" + head + \" from the queue\");\n System.out.println(\"and the new head is now: \"+myQueue.peek());\n \n \/\/ find out if the queue contains an object\n System.out.println(\"Does the queue contain 'Weekend'? \" + myQueue.contains(\"Weekend\"));\n System.out.println(\"Does the queue contain 'Monday'? \" + myQueue.contains(\"Monday\"));\n }\n \n}\n\n\n\n\n\n\n\n\n\n\nAs you can see in the code above, in order to create a queue we should assign LinkedList instance to the Queue object. In addition, you can notice how we call and use the functions we explained before. Also, it is worth to mention that you can use more methods that Queue inherits from Collection, such as contains() method.\n\n\n\nYou can see the output of the execution of the above code.\n\n\n\nOutput\n\n\n\nWednesday inserted successfully? true\nPick the head of the queue: Monday\n1) Push out Monday from the queue and the new head is now: Thursday\n2) Push out Thursday from the queue and the new head is now: Wednesday\nDoes the queue contain 'Weekend'? true\nDoes the queue contain 'Monday'? false\n\n\n\nIn this next example of java queue, we will discuss the Java BlockingQueue. Java BlockingQueue implementations are thread-safe. All queuing methods are atomic in nature and use internal locks or other forms of concurrency control. Java BlockingQueue interface is part of java collections framework and it\u2019s primarily used for implementing the producer-consumer problem. In the code example shown below, we will be using the ArrayBlockingQueue concrete class, which is one of the implementations of BlockingQueue Interface. \n\n\n\nFirst we will define the structure of the object which will be passed between the Producer and Consumer.\n\n\n\nMessageClass.java\n\n\n\npublic class MessageClass {\n private String messageString;\n\n public MessageClass(String passedString) {\n this.messageString = passedString;\n }\n\n public String getMessageString() {\n return messageString;\n }\n\n}\n\n\n\nNext, we will define the Producer class and Consumer class.\n\n\n\nProducerClass.java\n\n\n\nimport java.util.concurrent.BlockingQueue;\n\npublic class ProducerClass implements Runnable {\n\n private BlockingQueue<MessageClass> queue;\n\n public ProducerClass(BlockingQueue<MessageClass> q) {\n this.queue = q;\n }\n\n @Override\n public void run() {\n for (int i = 0; i < 5; i++) {\n MessageClass msg = new MessageClass(\"\" + i);\n try {\n Thread.sleep(i);\n queue.put(msg);\n System.out.println(\"Produced \" + msg.getMessageString());\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n MessageClass msg = new MessageClass(\"exit\");\n try {\n queue.put(msg);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n}\n\n\n\n\nConsumerClass.java\n\n\n\nimport java.util.concurrent.BlockingQueue;\n\npublic class ConsumerClass implements Runnable {\n\n private BlockingQueue<MessageClass> queue;\n\n public ConsumerClass(BlockingQueue<MessageClass> q) {\n this.queue = q;\n }\n\n @Override\n public void run() {\n try {\n MessageClass msg;\n while ((msg = queue.take()).getMessageString() != \"exit\") {\n Thread.sleep(10);\n System.out.println(\"Consumed \" + msg.getMessageString());\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n}\n\n\n\n\nFinally, we will define the driver class for the application.\n\n\n\nBlockingQueueExample.java\n\n\n\nimport java.util.concurrent.ArrayBlockingQueue;\nimport java.util.concurrent.BlockingQueue;\n\npublic class BlockingQueueExample {\n public static void main(String[] args) {\n BlockingQueue<MessageClass> queue = new ArrayBlockingQueue<>(10);\n ProducerClass producer = new ProducerClass(queue);\n ConsumerClass consumer = new ConsumerClass(queue);\n new Thread(producer).start();\n new Thread(consumer).start();\n System.out.println(\"BlockingQueue Example\");\n System.out.println(\"Producer and Consumer has been started\");\n }\n}\n\n\n\n\nThis driver class initiates both the Producer and Consumer class objects. Producer will start producing in a thread safe way and Consumer consumes in similar manner as producer. Output of the BlockingQueueExample.java is shown in the snapshot below.\n\n\n\nOutput of BlockingQueueExample.java\n\n\n\nThis next example is about the BlockingDeque in Java. The BlockingDeque interface in the java.util.concurrent class represents a deque which is thread safe to put into, and take instances from. The BlockingDeque class is a Deque which blocks threads tring to insert or remove elements from the deque, in case it is either not possible to insert or remove elements from the deque. The LinkedBlockingDeque class implements the BlockingDeque interface. The LinkedBlockingDeque is a Deque which will block if a thread attempts to take elements out of it while it is empty, regardless of what end the thread is attempting to take elements from.\n\n\n\nThe code snippet showing the BlockingDeque in action is shown below.\n\n\n\nBlockingDequeExample.java\n\n\n\nimport java.util.concurrent.BlockingDeque;\nimport java.util.concurrent.LinkedBlockingDeque;\n\npublic class BlockingDequeExample {\n public static void main(String[] args) {\n System.out.println(\"Blocking DeQueue Example\");\n BlockingDeque<Integer> LBD\n = new LinkedBlockingDeque<>();\n\n LBD.add(7855642);\n LBD.add(35658786);\n LBD.add(5278367);\n LBD.add(74381793);\n\n System.out.println(\"Blocking Deque1: \"\n + LBD);\n System.out.println(\"Size of Blocking Deque1: \"\n + LBD.size());\n\n BlockingDeque<Integer> LBD1\n = new LinkedBlockingDeque<>(3);\n\n LBD1.add(7855642);\n LBD1.add(35658786);\n LBD1.add(5278367);\n\n try {\n LBD1.add(74381793);\n }\n catch (Exception e) {\n System.out.println(\"Exception: \" + e);\n }\n\n System.out.println(\"Blocking Deque2: \"\n + LBD1);\n System.out.println(\"Size of Blocking Deque2: \"\n + LBD1.size());\n\n BlockingDeque<Integer> LBD2\n = new LinkedBlockingDeque<>(LBD1);\n\n System.out.println(\"Blocking Deque3: \"\n + LBD2);\n }\n}\n\n\n\n\nIn this code snippet, we are trying to add the elements to the blocking double ended queue and handle the exception when the count of elements exceeds the capacity of the deque. Output of BlockingDequeExample.java is shown below.\n\n\n\nOutput of BlockingDequeExample.java\n\n\n\nIn this last example of java queue we will discuss the TransferQueue. \n\n\n\nTransferQueue allows us to create programs according to the producer-consumer pattern, and coordinate messages passing from producers to consumers.\n\n\n\nThe implementation is actually similar to the BlockingQueue \u2013 but gives us the new ability to implement a form of back-pressure. This means that, when the producer sends a message to the consumer using the transfer() method, the producer will stay blocked until the message is consumed. \n\n\n\nThe LinkedTransferQueue class in Java is a part of the Java Collection Framework and implements the TransferQueue Interface.\n\n\n\nThe code snippet showing the TransferQueue in action is shown below.\n\n\n\nTransferQueueExample.java\n\n\n\nimport java.util.concurrent.LinkedTransferQueue;\nimport java.util.concurrent.TransferQueue;\n\npublic class TransferQueueExample {\n public static void main(String[] args) {\n System.out.println(\"Transfer Queue Example\");\n TransferQueue<Integer> LTQ\n = new LinkedTransferQueue<>();\n\n LTQ.add(7855642);\n LTQ.add(35658786);\n LTQ.add(5278367);\n LTQ.add(74381793);\n\n System.out.println(\"Transfer Queue1: \"\n + LTQ);\n\n TransferQueue<Integer> LTQ2\n = new LinkedTransferQueue<>(LTQ);\n\n System.out.println(\"Transfer Queue2: \"\n + LTQ2);\n }\n}\n\n\n\n\nOutput of TransferQueueExample.java is shown in the snapshot below. \n\n\n\nOutput of TransferQueueExample.java\n\n\n\n6. More articles\n\n\n\nArrayList Java Example \u2013 How to use arraylistJava Array \u2013 java.util.Arrays Example (with Video)Java List ExampleJava Stack ExampleLinkedList Java Example\n\n\n\n7. Download the Source Code\n\n\n\nThat was an example of Java Queue and Priority queue in Java.\n\n\n\nDownload\nYou can download the full source code of this example here: Java Queue Example\n\n\n\nLast updated on May 03rd, 2021\n","publisher":{"@id":"#Publisher","@type":"Organization","name":"Examples Java Code Geeks","logo":{"@type":"ImageObject","url":"\/wp-content\/uploads\/2013\/05\/JavaCodeGeeks-logo.png"},"sameAs":["https:\/\/feeds.feedburner.com\/examplesjavacodegeeks","https:\/\/www.facebook.com\/javacodegeeks","https:\/\/twitter.com\/javacodegeeks","https:\/\/www.linkedin.com\/groups\/3810709\/","https:\/\/www.youtube.com\/channel\/UCxoUc7Rar2q90Gu0nT2ffuQ","https:\/\/github.com\/javacodegeeks\/"]},"sourceOrganization":{"@id":"#Publisher"},"copyrightHolder":{"@id":"#Publisher"},"mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-queue-example\/","breadcrumb":{"@id":"#Breadcrumb"}},"author":{"@type":"Person","name":"Abhinav Nath Gupta","url":"https:\/\/examples.javacodegeeks.com\/author\/abhinav_nath-gupta\/"},"image":{"@type":"ImageObject","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":1200,"height":150}}
| og:locale | en_US |
| og:type | article |
| og:site_name | Examples Java Code Geeks |
| article:publisher | https://www.facebook.com/javacodegeeks |
| article:author | https://www.facebook.com/ang1989 |
| article:published_time | 2014-04-08T07:57:58+00:00 |
| article:modified_time | 2022-07-06T12:38:02+00:00 |
| og:image | https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg |
| og:image:width | 150 |
| og:image:height | 150 |
| og:image:type | image/jpeg |
| author | Abhinav Nath Gupta |
| twitter:card | summary_large_image |
| twitter:creator | @abhiit89 |
| twitter:label1 | Written by |
| twitter:data1 | Abhinav Nath Gupta |
| twitter:label2 | Est. reading time |
| twitter:data2 | 11 minutes |
| None | IE=edge |
| msapplication-TileImage | https://examples.javacodegeeks.com/wp-content/uploads/2013/05/JavaCodeGeeks-favIcon.png |
Links:
Viewport: width=device-width, initial-scale=1.0
Robots: index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1