nata.r<br />**********************************<br />To win is not always success<br />And to lose is not always failure.<br />**********************************
SCJP2
nata.r<br />**********************************<br />To win is not always success<br />And to lose is not always failure.<br />**********************************
SCJP2
Given byte b2[][][][] = new byte [2][3][1][2];
the following are true:
b2 is a 4-dimensional array
b2[0] is a 3-dimensional array//isn't that a 1-dimensional array?
b2[0][0] is a 2-dimensional array
b2[0][0][0] is a 1-dimensional array//isn't this a 3-D array?
b2[0][0][0][0] is a byte
Kapil Munjal
SCJP 1.4, SCWCD 1.4
Originally posted by Nata Raman
a) b2[0][2]=b; b) b[0][0]=b3; c) b2[1][1][0]=b[0][0]; d) b2[1][2][0]=b;
d) b2[0][1][0][0] = b[0][0]; f) b2[0][1] = big;
The answers are a,b,e and f. The explanation states that "If an array is declared as a two dimensional array, you can't assign a one dimensional array to a one-dimesional array reference"
What's that? If i declare an array as two dimesional what does the one dimensional array got to do with that?
---<br />SCJP 1.4
nata.r<br />**********************************<br />To win is not always success<br />And to lose is not always failure.<br />**********************************
Don't get me started about those stupid light bulbs. |