Java Lambda

From Chorke Wiki
Revision as of 22:25, 5 September 2021 by Shahed (talk | contribs)
Jump to navigation Jump to search
Map<String, String> insured = Stream.of("Adults:1", "Children:1", "Senior Citizen:10")
                                    .map(pair -> pair.split(":"))
                                    .collect(Collectors.toMap(array -> array[0], array->array[1]));


References