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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -