java.util.Map.Entry接口主要就是在遍历map的时候用到,给你个例子: package test; import java.util.*; import java.util.Map.Entry; public class B { public static void main(String[] args) { Map mm = new HashMap (); for(int i=0;i<10;i++) { mm.put(i, i); } for( Entry e : mm.entrySet()) { System.out.println("key:"+e.getKey()); System.out.println("value:"+e.getValue()); } for( Iterator > i = mm.entrySet().iterator();i.hasNext(); ) { Entry e = i.next(); System.out.println("key:"+e.getKey()); System.out.println("value:"+e.getValue()); } } }