Solved

# Multiplication

Posted on 2005-03-30

Question. I have this tutorial regarding Arrays.

/**

* Builds an integer multiplication table. No particular

* behavior is guarenteed for a negative input value. For

* example, if max was 3, the table would look like this:

* +-+-+-+-+

* |0|0|0|0|

* +-+-+-+-+

* |0|1|2|3|

* +-+-+-+-+

* |0|2|4|6|

* +-+-+-+-+

* |0|3|6|9|

* +-+-+-+-+

* Notice that the table has max+1 rows and columns.

*

* @param max The number the table goes up to

*/

public int[][] getMultTab(int max)

{

int row = 0;

int col = 0;

int[][] ans = new int[row][col];

for (int i = 0; i < ans.length; i++)

for (int j = 0; j < ans[i].length; j++)

ans[i][j] = i*j;

return max[][];

}

}

Am I going abou this the right way? I dont think i'm thinking about it correctly. Any insight into this would be helpfull. I'm trying to understand this array stuff. If anybody has a simplistic way to view how you would look at this, it would help greatly.

Thanks You,

David McGraw