Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java.lang.classcastexception: java.lang.string cannot be cast to java.util.arraylist

// It sounds like you are trying to cast a String array to ArrayList. 
// (ArrayList)StringArray[] would not work.
// Try the following code instead.

ArrayList<String> test1 = new ArrayList(Arrays.asList(StringArray));
 
PREVIOUS NEXT
Tagged: #cast
ADD COMMENT
Topic
Name
4+3 =