Derek Smiths wrote:ans: matrixOne[0].length since all the column lengths will be the same.
Erm, isn't that making an assumption?
I suspect that would be fine for the types of matrix we did in school, but
Java could quite happily sum two matrices of different sizes, and even different column lengths, so my answer to your question would be:
int sumMatrix [][] = new int[Math.max(matrixOne.length, matrixTwo.length)][];
and then decide when you're actually working on a row what size it should be.
Winston