public static void main(String[] args)
{
em e1=new em(1,"me",100);
em e2=new em(2,"she",1000);
em e3=new em(3,"he",10000);
Map<Integer,em> map=new HashMap<>();
map.put(10, e1);
map.put(11, e2);
map.put(13, e3);
em e5=map.get(11);
}
}
em(int id,String name,double salary)
{
this.id=id;
this.name=name;
this.salary=salary;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
}
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。