Online Java Compiler By
JavaTpoint.com
import java.util.Spliterator; import java.util.concurrent.LinkedTransferQueue; public class LinkedTransferQueueSpliteratorMethodExample2 { static int i =0; public static void main(String[] args) { LinkedTransferQueue
queue = new LinkedTransferQueue(); queue.add("Kristen"); queue.add("Harry"); queue.add("Jack"); //spliterator split and iterate the split parts in parallel Spliterator
str = queue.spliterator(); // performs the action for each remaining element str.forEachRemaining( (n)-> { String lc = n.toUpperCase(); System.out.println(++i +" Lower case = "+n); System.out.println(i +" Upper case = "+lc); System.out.println(); } ); } }
Output