Java List spliterator() Method

24 Mar 2025 | 2 min read

The spliterator() method of List Interface creates a Spliterator over the elements in the given list.

Syntax

Parameters

NA

Specified by

  • spliterator() in interface Collection<E>
  • spliterator() in interface Iterable<E>

Returns:

The spliterator() method returns a Spliterator over the elements in this list.

Example 1

Output:

 Values : 1 2 3 4 5 6 7 8 9 10 

Example 2

Output:

 Name : Reema School : Gita Convent School Course : Java Name : Geetu School : Gita Convent School Course : Android Name : Saloni School : Eicher Public School Course : Java 

Example 3

Output:

 Values : 12345678910 
Next TopicJava List