如代码所示:
- import java.util.*;
- class Map
- {
- public static void main(String[] args)
- {
- Map<Integer,String> mp=new HashMap<Integer,String>();
- mp.put(010,"zhangsan1");
- mp.put(011,"zhangsan1");
- mp.put(012,"zhangsan1");
- mp.put(013,"zhangsan1");
- mp.put(014,"zhangsan1");
- System.out.print(mp);
- }
- }
复制代码
这里我的key键值 前边带着0时,输出结果是
{8=zhangsan1, 9=zhangsan1, 10=zhangsan1, 11=zhangsan1, 12=zhangsan1}
当把put中的去掉后代码:
- Map<Integer,String> mp=new HashMap<Integer,String>();
- mp.put(10,"zhangsan1");
- mp.put(11,"zhangsan1");
- mp.put(12,"zhangsan1");
- mp.put(13,"zhangsan1");
- mp.put(14,"zhangsan1");
- System.out.print(mp);
复制代码
这里把0 删去后运行结果是这样的
{10=zhangsan1, 11=zhangsan1, 12=zhangsan1, 13=zhangsan1, 14=zhangsan1}
谁能帮小弟解决一下疑惑啊 谢谢!!!
|
|