Choose the best option based on this code segment:
"abracadabra".chars().distinct().peek(ch -> System.out .printf("%c ", ch)).sorted();
D.
a stream pipeline is lazily evaluated.
Since there is no terminal operation provided (such as count()
, forEach()
, reduce()
, or collect()
), this pipeline is not evaluated and hence the peek()
method does not print any output to the console.