import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ListMap {
/**
* @param args
* <br>
* @exception 例外
* @since 1.0.0
*/
public static void main(String[] args) {
Map maps = new HashMap();
maps.put("5", "a");
maps.put("4", "b");
maps.put("3", "c");
maps.put("2", "d");
maps.put("7", "e");
maps.put("1", "f");
List list = new ArrayList();
System.out.println(maps);
Object[] o = ((HashMap) maps).keySet().toArray();
Arrays.sort(o);
int maxKey = Integer.parseInt((String)o[o.length - 1]);
for (int i = 1; i <= maxKey; i++) {
if (maps.containsKey(String.valueOf(i))) {
list.add(maps.get(String.valueOf(i)));
} else {
list.add(maps.get(""));
}
}
System.out.println(list);
}
}
1.读万卷书
2.行千里路
3.阅人无数