public void Delete(){
System.out.println("输入要删除学生的id:");
cin = new Scanner(System.in);
String id=cin.next();
Students stu=students.get(id);
if(stu==null){
System.out.println("没有该学生!");
}
else{
students.remove(id);
}
}
System.out.println("输入要删除学生的id:");
cin = new Scanner(System.in);
String id=cin.next();
Students stu=students.get(id);
if(stu==null){
System.out.println("没有该学生!");
}
else{
students.remove(id);
}
}
2016-02-23
最赞回答 / 对方正在学习
集合内元素的存放顺序和hashcode有关,而哈希表是用算法把不同的数据按照规则放在响应的地址里,所以位置应该是确定的,至于set的无序性指的应该是输出数据的顺序不是用户可以控制的,所以对于用户来说是无序的。
2016-02-23
已采纳回答 / JPlin
有感叹号 的是修改的地方//!!!!!!!!!!!!!!!!!!!!!!!!!!!!Main类中:public class Start { public static void main(String[] args) { // TODO Auto-generated method stub MakePuKe a1 = new MakePuKe(); a1.createPuKe(); a1.xiPai(); PlayGame p1 =new PlayGame(); p1.player1(...
2016-02-23