Online Java Compiler By
JavaTpoint.com
import java.util.Spliterator; import java.util.concurrent.LinkedTransferQueue; public class LinkedTransferQueueSpliteratorMethodExample1 { static int i=1; public static void main(String[] args) { LinkedTransferQueue
queue = new LinkedTransferQueue(); for (char ch='A';ch<='Z';ch++) { queue.add(ch); } System.out.print("Alphabets : "); //spliterator split and iterate the split parts in parallel Spliterator
str = queue.spliterator(); // if element exists tryAdvance() will perform action while(str.tryAdvance((n)->System.out.print(n+" "))); } }
Output