在操作的时候,通常会有数组和集合之间的转换、不多说、直接放code. 高手就不要看了、
public static List<String> retList(String[] words){
List<String> wordList = Arrays.asList(words);
return wordList;
}
public static String[] retArray(List words){
String[] strs = new String[words.size()];
return words.toArray(strs);;
}
这是使用jdk来操作的、很方便的将集合之间进行了转换。
后续还有其他的的转换在补上。