Java Lambda
Map<String, String> insured = Stream.of("Adults:1", "Children:1", "Senior Citizen:10")
.map(pair -> pair.split(":")).collect(Collectors.toMap(pair -> pair[0], pair->pair[1]));
References
|
Map<String, String> insured = Stream.of("Adults:1", "Children:1", "Senior Citizen:10")
.map(pair -> pair.split(":")).collect(Collectors.toMap(pair -> pair[0], pair->pair[1]));
|