zoukankan      html  css  js  c++  java
  • 235课后第三题

    package com.hanqi;

    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.Map;
    import java.util.Set;


    public class list {

    public static void main(String[] args) {


    Map map = new HashMap(); Emp emp = new Emp("005","小明"); Emp emp1 = new Emp("006","小张"); Emp emp2 = new Emp("007","小王"); HashMap<String,String> map1 = new HashMap<String,String>(); map1.put(emp.getId(), emp.getName()); map1.put(emp1.getId(), emp1.getName()); map1.put(emp2.getId(), emp2.getName()); System.out.println(map1); map1.remove("005"); System.out.println(map1);
    package com.hanqi;
    
    public class Emp {
    
        /*public Emp(String string, String string2) {
            
        }*/
        private String id;
        
        private String name;
        
    public Emp(String id, String name) {
        
         super();
         this.id = id;
         this.name = name;
            
        }
    
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
        
    
    }

  • 相关阅读:
    until循环
    linux的shell使用
    shell通配符(元字符)
    linu运算
    mail邮件
    linux命令
    redis笔记
    mysql 5.7安装方法
    mysql5.7.25搭建mysql-5.7.25.tar.gz包(亲验)
    mysql数据迁移
  • 原文地址:https://www.cnblogs.com/Yue0327/p/5152830.html
Copyright © 2011-2022 走看看