java - Incompatible types when converting List to String array -
i seem getting error when trying convert list array, code
list text = loadfile(pathname); string[] converteddata = text.toarray(new string[text.size()]);
the error i'm getting is:
incompatible types: java.lang.object[] cannot converted java.lang.string[].
not sure why , if anymore information needed ill happy post, appreciated.
use generic list of strings:
list<string> text = loadfile(pathname); and make sure loadfile method returns list<string>.
Comments
Post a Comment