java将String数组的元素变为map<string,string>
String title[]={"a","b"}; List<String> list = Arrays.asList(title); Map<String, String> titleMap = list.stream().collect(Collectors.toMap(x -> x, x -> x));
String title[]={"a","b"}; List<String> list = Arrays.asList(title); Map<String, String> titleMap = list.stream().collect(Collectors.toMap(x -> x, x -> x));
相关推荐