Consider a class that has this private instance variable:
private int[][] mat;
The class has the following method, alter.
public void alter(int c)
{
for (int i = 0; i < mat.length; i++)
for (int j = c + 1; j < mat[0].length; j++)
mat[i][j-1] = mat[i][j];
}
If a 3 × 4 matrix mat is
1 3 5 7
2 4 6 8
3 5 7 9
then alter(1) will change mat to
(A)
1 5 7 7
2 6 8 8
3 7 9 9
(B)
1 5 7
2 6 8
3 7 9
(C)
1 3 5 7
3 5 7 9
(D)
3 5 7
3 5 7 9
3 5 7 9
(E)
1 7 7 7
2 8 8 8
3 9 9 9