import java.util.Map;
import java.util.HashMap;
public class MyClass
{
public static void main(String[] args)
{
Map<String, Integer> hm = new HashMap();
hm.put("java", 2);
hm.put("python", 5);
hm.put("c", 1);
hm.put("c++", 3);
hm.put("php", 6);
hm.put("cobol", 8);
Map<String, Integer> filteredMap = new HashMap<>();
for (Map.Entry<String, Integer> entry: hm.entrySet()) {
if (entry.getKey().startsWith("c")) {
filteredMap.put(entry.getKey(), entry.getValue());
}
}
System.out.println(filteredMap);
}
}
/*
run:
{c++=3, c=1, cobol=8}
*/