I have a function which has values in matrix form with String... array (var args in jdk 1.4) format. Can I add the values having 2D array and adding the values from the array in it.
Matrix m = new Matrix(3,3,
"2", "2", "5 /",
"3 3 *", "7", "2",
"1 1 +", "1 1 /", "3"
);
And the function call :
public Matrix(int nRows, int nCols, String... exprArray) {
Stack<String []> tks = new Stack<String []>();
String arr[][] = null ;
for(int i = 0; i < nRows; i++){
for(int k = 0; k<nCols;k++){
/****Add the value in 2D array using exprArray dont know how to do it can anyone help me out here *****/
arr[i][k] = exprArray[i];
System.out.println(arr[i][k]);
}
}
}