我
LinkedHashMap<String, List<String>> hMap;
我想获得名单,其中,字符串&GT;
按位置不是关键
我不希望使用迭代。
有没有其他办法以指数值?
Is there any other way to get Value based on index ?
您不能得到地图
基于指数的值,地图
只是不这样的。一种解决方法是创建从你的价值一个新的列表,并获得基于索引的价值。
You can't get the value of the Map
based on index, Map
s just don't work that way. A workaround would be to create a new list from your values and get the value based on index.
LinkedHashMap<String, List<String>> hMap;
List<List<String>> l = new ArrayList<List<String>>(hMap.values());
l.get(0);