【发布时间】:2016-10-03 08:59:19
【问题描述】:
public class CommandArgsThree
{
public static void main(String [] args)
{
String [][] argCopy = new String[2][2];
int x;
argCopy[0] = args;
x = argCopy[0].length;
for (int y = 0; y < x; y++)
{
System.out.print(" " + argCopy[0][y]);
}
}
}
命令行调用是: java CommandArgsThree 1 2 3
1.上面的命令和这个有什么区别:java CommandArgsThree 123,args的类型是什么以及它对不同输入的行为。
String [][] argCopy = new String[2][2];
2.上述语句是否创建了一个二维字符串数组,即它
null null
null null
因为这可以通过 argCopy[0][0],argCopy[0][1] 访问 或
{null,null,null,null}
因为这可以通过 argCopy[0],argCopy[1],argCopy[2],,,, 访问。
【问题讨论】:
标签: java command-line