62,623
社区成员
发帖
与我相关
我的任务
分享
package mypack;
import java.util.*;
public class Test {
public static void main(String[] args){
LinkedHashMap<String, String> ht = new LinkedHashMap<String, String>();
ht.put("awrewe", "3");
ht.put("d23", "2");
ht.put("c113", "1");
Set s = ht.keySet();
for(Object o: s) {
String str = (String)o;
System.out.println(str);
}
}
}
/*结果:
awrewe
d23
c113*/
public static void main(String[] args){
LinkedHashMap<String, String> ht = new LinkedHashMap<String, String>();
ht.put("awrewe", "3");
ht.put("d23", "2");
ht.put("c113", "1");
Set s = ht.keySet();
for(Object o: s) {
String str = (String)o;
System.out.println(str);
}
}