This question is from Kathy-Bert book (ch.1)selfTest.
>
java CommandArgsThree 1 2 3
The array argCopy is constructed as new
String[2][2].
when args is assigned to argCopy[0], should it not give an error?
Because:
The value of args is 3 (from command line) and the array is just initialized as 2X2 array. When you are assiging argCopy[0]=3, dont you have to reassign memory to the new element?
argsNew= new String [args]
argCopy[0]= argsNew // would this work?
Dont you have to use new is you are changing(allocating) space to array in the program?
Please help me understand this.
Thank you
[Dan added the UBB code to format the code block.]
[ February 24, 2003: Message edited by: Dan Chisholm ]