set.add(huahua01); //显示宠物猫信息 System.out.println("++++++++++++++++++"); System.out.println("+++++添加宠物猫后的输出+++++"); it = set.iterator(); while (it.hasNext()) { System.out.println(it.next()); } //重新插入新的宠物猫信息 Cat huahua02 = new Cat("花花二代"...
Map集合-根据宠物昵称查找宠物 1 package collection; 2 3 /** 4 * 宠物类 5 * @author 6 * 7 */ 8 public class Pet { 9 private String name; 10 private String strian; 11 12 public Pet() { 13 } 14 15 public Pet(String name, String strian) { 16 this.name = name; 17 this.str...