日期:2014-05-20 浏览次数:20584 次
import java.util.*; public class Ex20{ public static void main(String[] args){ String[] en={"one","two","three"}; String[] ch={"一","二","三"}; Map<String,String> map = new HashMap<String, String>(); for(int i=0;i<en.length;++i){ map.put(en[i], ch[i]); } for(Map.Entry<String, String> obj:map.entrySet()){ System.out.println(obj.getKey()+"翻译:"+obj.getValue()); } } }