日期:2014-05-20 浏览次数:20634 次
package holding; import static net.mindview.util.Print.print; import java.util.HashMap; import typeinfo.pets.Person; import typeinfo.pets.Pet; public class KeepCount extends HashMap { static KeepCount kc=new KeepCount(); public void add() { this.put("good","99.9" ); this.put("bad","10" ); this.put("soso","70" ); this.put("good","90" ); this.put("good","86" ); this.put("bad","50" ); this.put("soso","60" ); this.put("soso","84" ); this.put("good","99" ); this.put("bad","40" ); this.put("bad","56" ); this.put("soso","71" ); this.put("good","87" ); this.put("bad","51" ); this.put("soso","65" ); this.put("good","100" ); } public static void main(String[] args) { kc.add(); System.out.println(kc); for(Object person : kc.keySet()) { print(person); for(Object pet : kc.get(person)) //这行错了,说什么不能迭代什么的 print(" " + pet); } } }