List<String> to ArrayList<String> conversion issue
问题 I have a following method...which actually takes the list of sentences and splits each sentence into words. Here is it: public List<String> getWords(List<String> strSentences){ allWords = new ArrayList<String>(); Iterator<String> itrTemp = strSentences.iterator(); while(itrTemp.hasNext()){ String strTemp = itrTemp.next(); allWords = Arrays.asList(strTemp.toLowerCase().split("\\s+")); } return allWords; } I have to pass this list into a hashmap in a following format HashMap<String, ArrayList