Online Java Compiler By
JavaTpoint.com
import java.util.LinkedList; import java.util.List; import java.util.Spliterator; public class JavaListSpliteratorExample3 { public static void main(String[] args) { List
list = new LinkedList<>(); for (int i=1;i<=10;i++) { list.add(i); } System.out.println("Values : "); //spliterator split and then iterate the split parts in parallel Spliterator
str = list.spliterator(); // if the specified element exists then the forEachRemaining() will perform the given action str.forEachRemaining(System.out::print); } }
Output