In addition to methods that Queue inherits from Collection, Queue defines several of its own methods that are as follows:ġ. Queue q = new ArrayDeque() Methods of Java Queue Interface When you need to create a queue, simply initialize a Queue variable with a LinkedList object as given below: Queue q = new LinkedList() For simple FIFO queues, LinkedList and ArrayDeque classes are the best choices to create a queue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |