DoubleStream spliterator() example

Description

DoubleStream spliterator() returns spliterator for DoubleStream.

Syntax

spliterator has the following syntax.


Spliterator.OfDouble spliterator()

Example

The following example shows how to use spliterator.


import java.util.Spliterator;
import java.util.stream.DoubleStream;
// www .  j  a va  2s.c o  m
public class Main {
  public static void main(String[] args) {
    DoubleStream b = DoubleStream.of(1.1,2.2,3.3,4.4,5.5);
    Spliterator.OfDouble o = b.spliterator();
    System.out.println(o.characteristics());
  }
}

The code above generates the following result.





















Home »
  Java Streams »
    Reference »




Collectors
DoubleStream
DoubleStream.Builder
IntStream
IntStream.Builder
LongStream
LongStream.Builder
Stream
Stream.Builder