GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — ConcurrentLinkedQueue iterator() method in Java - GeeksforGeeks ConcurrentLinkedQueue iterator() method in JavaLast Updated : 26 Nov, 2018 The iterator() method of ConcurrentLinkedQueue is used to returns an iterator of the same elements as this ConcurrentLinkedQueue in a proper sequence. The elements returned from this method contains elements in order from first(head) to last(tail). The returned iterator is weakly consistent.
Syntax:
public Iterator iterator()Returns: This method returns the iterator having same elements as present in ConcurrentLinkedQueue in Proper Sequence. Below programs illustrate iterator() method of ConcurrentLinkedQueue: Example 1:
Output:
Example 2:
ConcurrentLinkedQueue : [Aman, Amar, Sanjeet, Rabi] The String Values of iterator are: Aman Amar Sanjeet Rabi
Output:
Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html#iterator--ConcurrentLinkedQueue: [4353, 7824, 78249, 8724] The Numbers of iterator are: 4353 7824 78249 8724 Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |