posted 23 years ago
The second statement in 1) won't compile because d is defined as a double array, and c is defined as a single array.
Changing to: double [][] c = d ; will compile.
Statements in 2) compile without problem (2-dimensional array being assigned to another 2-dimensional array).
The 3rd statement in 3) won't compile. First, the statement is missing the ";" at the end. However d={a,a} ; still gives a illegal start of expression error.
However, using a double[][] d = { a , a } ; after the first statement will compile without error. Why the compiler will not let you split the declaration and the initialization is beyond me. I would appreciate it if someone could let me know why!
Statements 3 and 5 in the 4) won't compile, becuase you're trying to assign two-dimensional arrays into variables that have been defined as single-dimensional arrays.
[This message has been edited by Joe McGuire (edited May 23, 2001).]