Java PriorityQueue spliterator() MethodThe spliterator() method of the PriorityQueue class creates a late-binding and fail-fast Spliterator that does not traverse the elements in any particular order in this queue. SyntaxParameterNA Specified ByThe spliterator() method of the PriorityQueue class is specified by:
Return ValueThe spliterator () method returns a Spliterator over the elements in the queue. Example 1Test it NowOutput: 1 Name - Avijit 2 Name - Bani 3 Name - Chehak Example 2Test it NowOutput: 1 Lower case = aman 1 Upper case = AMAN 2 Lower case = bhavika 2 Upper case = BHAVIKA 3 Lower case = chavi 3 Upper case = CHAVI 4 Lower case = chandan 4 Upper case = CHANDAN Example 3Test it NowOutput: 1 Roll No = 15cs1029 Name = Reema panda Marks = 21 2 Roll No = 15cs1012 Name = Geetanjali Sharma Marks = 26 3 Roll No = 15cs1011 Name = HimanshuBhardwaj Marks = 27
Next TopicJava PriorityQueue
|