What will be the result of executing this code segment?
Stream.of("ace ", "jack ", "queen ", "king ", "joker ") .mapToInt(card -> card.length()) .filter(len -> len > 3) .peek(System.out::print) .limit(2);
d)
the limit()
method is an intermediate operation and not a terminal operation.
Since there is no terminal operation in this code segment, elements are not processed in the stream and hence it does not print anything on the console.