I have defined a map like below and it has lists of strings as values
Map<Integer,List<String>> MapOf_words_arrays = new HashMap<Integer,List<String>>();
I need to get the values of above Map in to one string array (e.g shown below) , .
["dog","cat"]
["book","pen","phone","waterbottle"]
.
.
.etc
I'm using the below statement
String wordlists = MapOf_words_arrays.values().toArray(new String[0]);
but I'm getting an error
Exception in thread "main" java.lang.ArrayStoreException: java.util.ArrayList$SubList at java.util.AbstractCollection.toArray(AbstractCollection.java:196) at ScrapePages.main(ScrapePages.java:98)
Can anybody help me out here?