Skip to content
Quiz · Lambdas and the Stream API · lesson 10 of 12

Quiz — a stream with no terminal operation

What does the program print?

JAVA
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Integer> xs = List.of(1, 2, 3);
        xs.stream().map(x -> {
            System.out.print(x + " ");
            return x * 2;
        });
        System.out.println("end");
    }
}