[Ljava.lang.String; cannot be cast to java.lang.String [How to Solve]

Complete error message:

java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String

The reason for this error is:

Set [ljava. Lang. string; The array type represented by java.lang.string is cast to the string type represented by java.lang.string, and the type mismatch between the two causes an error

Note:[Ljava.lang.String@1b634e7  -- 
   "[" Indicates a one-dimensional array 
    "[[" means a two-dimensional array 
    "L" means an object 
    "String" indicates the type of the object 
    "@" followed by the HashCode of the object

 

Similar Posts: