给的例子是错的吗我为何会报错
ackage com.project9;
public class Initail {
public static void main(String[] args)
{
String str="学习 Java 编程";
System.out.println(str.length());
char c='J';
System.out.println(str.indexOf(c));
System.out.println(str.indexOf("Java"));
String[] name=str.split(" ");
System.out.print(Arrays.toString(name));//报错语句
System.out.println();
}
}