代码部分:
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ddd {
public static void main(String[] args) {
String[] str = {"0","1","9","5","3","4","6"};
List<String> list1 = new ArrayList<String>();
Collections.addAll(list1, str);
Map<String,Integer> map = new HashMap<String, Integer>(list1.size());
List<String> list = new ArrayList<String>();
for(String string:list1){
map.put(string, 1);
}
System.out.println( map.entrySet());
}
}
一个在eclipse中运行,一个是在MyEclipse中运行,jdk版本是1.8.
本人只是初学javase,不太明白,求大神指导
|
|