使用的测试代码
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class Test {
public static void main(String[] args) {
Map<Integer , String> map = new HashMap<Integer, String>();
map.put(1 , "a");
map.put(2 , "b");
for(int i = 3 ; i < 10 ; i++){
map.put(i , "x");
}
map = putMap(map);
Set<Integer> keys = map.keySet();
for (Integer key : keys){
System.out.println(key + ":" +map.get(key));
}
}
public static Map<Integer,String> putMap(Map<Integer,String> map){
map.put(11 , "m");
map.put(12 , "n");
return map;
}
}
会使用到的按键(如图)
按键的介绍
1. Step over(快捷键F8)