| 发表于:2007-02-13 20:00:44 楼主 |
for语句一般是for(初值表达式;条件表达式;迭代因子){} 这个for语句怎么理解: for(enumeration e=ht.elements();e.hasmoreelements();) system........... 完整如下: import java.util.*; public class hashtable{ public static void main(string[] args){ hahstable ht=new hashtable(); ht.put( "0011-123 ", "江泽民 "); ht.put( "0012-456 ", "李鹏 "); ht.put( "0013-789 ", "李瑞环 "); system.out.println( " <目录> "); for(enumeration e=ht.element();e.hasmoreelement();) system.out.println(e.nextelement()); } } |
|
|
|
|