字符串数组转化为字符串类型,如下代码错误求解
public class Test {
public static void main(String[] args) {
String[] st=new String[6];
for(int i=0;i<st.length;i++){
System.out.println(st.length);
st[i]=st[i].valueOf(i);
}
System.out.println(st.toString());//为啥输出是[Ljava.lang.String;@35ce36
}
}
------解决方案--------------------
System.out.println(st.toString());
==>
System.out.println(java.util.Arrays.toString(st));