Java 8 Split String and Create Map inside Map

You can use the following snippet for this:

Map<String, Map<String, String>> result = Arrays.stream(samp.split(","))
        .map(i -> i.split("-"))
        .collect(Collectors.groupingBy(a -> a[0], Collectors.toMap(a -> a[1], a -> a[2])));

First it creates a Stream of your items, which are mapped to a stream of arrays, containing the subitems. At the end you collect all by using group by on the first subitem and create an inner map with the second value as key and the last one as value.

The result is:

{101={1=5, 2=4}, 102={1=5, 2=5, 3=5}, 103={1=4}}

Map<String, Map<String, String>> map = Arrays.stream(samp.split(","))
        .map(s -> s.split("-"))
        .collect(Collectors.toMap(
                o -> o[0],
                o -> Map.of(o[1], o[2]),
                (m1, m2) -> Stream.concat(m1.entrySet().stream(), m2.entrySet().stream())
                        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))));

Map.of is from Java 9, you can use AbstractMap.SimpleEntry if you are on Java 8.

Samuel's answer is better though, much concise.