public static void main(String[] args) {
//创建Hashmap集合,输入二个类型数据,命名为hm
//new Hashmap<>();new一个新的Hashmap,由于前面有输入数据类型,所以可不写(jdk1.8之后)
HashMap<Integer,String> hm = new HashMap<>();
//输入二个类型:key.value ,
//输出的是地址域
System.out.println(hm.put(4,"洋洋"));
System.out.println(hm.put(5, "阿萨"));
System.out.println(hm.put(7, "盛大"));
//输出时, 张光的value会替代洋洋,但张光的key值不会替代洋洋的key=4;---因为key都是4,所以转换的哈希值都相等(只关注key),都会去同一个内存下,
//Integer的Hashcode方法,key值会对其调用输入,输出也为key的哈希码hash
System.out.println(hm.put(4, "张光"));
System.out.println(hm.put(9,"程式"));
System.out.println("主数组长度:"+hm.size());
System.out.println("主数组元素内容:"+hm);
/*根据Hashcode的哈希码(key),算出在主数组(Entry[])中存放的位置---Entry[]主数组存放的都为entry类型元素: