Re: Arrays.sort(s) caused an error



In article <1152634632.972731.315770@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"niceguy16" <yingjian.ma1955@xxxxxxxxx> wrote:

Hi,

I have this code:

String[] s= {"Mark","Steve","Pete"};
s=Arrays.sort(s);

The 2nd line has an error saying:
incompatible types
found : void
required: java.lang.String[]
s=Arrays.sort(s);
^
1 error

Why?

Thanks.

You didn't check the API for the Arrays.sort method, did you? It
doesn't return anything.
--
Steve W. Jackson
Montgomery, Alabama
.



Relevant Pages