what is the result of compiliing and running the following program
with the java Split1 a1+b3-c5=4x[12345][+-=] command ?public class Split1
{
public static void main(String[] args)
{
System.out.printlv((args[0].split(args[1])).length);
}}
这道题目怎么做啊?
请顺便把中文写出来哦
with the java Split1 a1+b3-c5=4x[12345][+-=] command ?public class Split1
{
public static void main(String[] args)
{
System.out.printlv((args[0].split(args[1])).length);
}}
这道题目怎么做啊?
请顺便把中文写出来哦
运行结果:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
因为只给了一个参数,所以args[1]数组越界
a1+b3-c5=4x[12345][+-=]这其中你是不是少输入了一个空格啊?似乎应是:a1+b3-c5=4x [12345][+-=]
不好意思 少了一个空格
B prints 2
C prints 4
D error
E Exception应该选择哪个?