I have method to convert 2d array of 3 (row and col) in to 2d method of 3+ 2 which is 2d array of 5(row and col). and the method give parameter of 2d array and find the total matrix. Here I have class and this class }
so and this my main class:
public static void main(String[] args) {
Operation operation = new Operation();
int w[][] = {{1,2,3},{4,5,6},{7,8,9}};
operation.convert(w);
Now the result it will come like the picture:
So I need to replace the zero with w array which is in main method.
I think all you need is:
newArray[i][j] = a[i-1][j-1]; // or perhaps a[j-1][i-1] if you want the transpose
You need to adjust the indices because newArray
has an extra row and column at index 0.