Java ConcurrentLinkedQueue iterator() MethodThe iterator() method of ConcurrentLinkedQueue class returns an iterator over the elements in ConcurrentLinkedQueue in proper sequence. SyntaxParameterNA. Specified ByThe iterator() method of ConcurrentLinkedQueue class is specified by:
Return ValueThe iterator() method returns an iterator over the elements in ConcurrentLinkedQueue. Example 1Output: 1.Ram 2.Sham 3.Mira 4.Rajesh Example 2Output: 1.1.Roll No. = 15cs1029 College = MVN University Name = Reema 2.2.Roll No. = 15cs1010 College = MVN University Name = Geetanjali 3.3.Roll No. = 17cs1029 College = MR University Name = Vineet 4.4.Roll No. = 15cs1011 College = MVN University Name = Himanshu Example 3Output: 71018 8000 1178 1190 Max number = 71018 Min number = 1178 |