What is the return type of the map() function in Java Streams API?
- List
- Stream
- int
- void
The map() function in Java Streams API transforms the elements of a stream and returns a new stream of the transformed elements. Therefore, the return type of map() is Stream. It allows you to apply a function to each element and map them to a new value or type.
Loading...
Related Quiz
- The FXMLLoader class is utilized to load ________ files.
- To execute a batch of commands, we use the ________ method.
- The method overriding is also known as ________ time polymorphism.
- What will be the output of the following code snippet: System.out.println("2" + 3);?
- The ______ interface is used when you want a task to return a value after execution in a thread.