2 dimensional array
If I have a 2d double array (double myArray), what will myArray.length return?
for instance if I was using it to store a matrix, such that the array is[row][col] format, and my matrix was:
3 4 5
6 7 4
6 4 4
so what would myArray.length return?
it would be a length of 3
I guess we're now the go-to substitute for a Java compiler. I find it's much easier asking these questions rather than writing a simple program, running it, and inspecting the output.
I guess it was more of a "why" does it return that, instead of a what. so if I had a 3x4 matrix, would it return 4?
Come on, for God's sake, try it.
Originally Posted by sehudson
Why? It think it is because a 2 dimensional array is just an array inside an array.