Learn Java 8 streams with an example - map() method
The map() function is a method in the Stream class that represents a functional programming concept. In simple words, the map() is utilized to transform one object into another by applying a function. Example 1: Stream map() function with the operation of converting uppercase to lowercase. import java.util. *; import java.util.stream.Collectors ; /*Stream map() function with operation of converting uppercase to lowercase. */ public class DriverClass { public static void main ( String [] args) { List < String > list = Arrays . asList ( "SAW" , "NUN" , "JOKER" , "REVENANT" , "CAST AWAY" ); List < String > result = list .stream(). map( String ::toLowerCase). collect( Collectors . toList ()); System . out .println( result ); } } Example 2: Java program to convert List of String to List of Integers import java.util. *; i