HashMap集合键是Student,值是String的案例
    键是学生对象,代表每一个学生
    值是字符串对象,代表学生归属地

    1. public static void main(String[] args) {
    2. HashMap<Student, String> hashMap = new HashMap<>();
    3. hashMap.put(new Student("张三", 23), "北京");
    4. hashMap.put(new Student("张三", 23), "上海");
    5. hashMap.put(new Student("李四", 24), "广州");
    6. hashMap.put(new Student("王五", 25), "深圳");
    7. System.out.println(hm);
    8. }