231k views
1 vote
Write a method to add/subtract two matrices. The header of the method is as follows:

public static double[][] addMatrix(double[][] a, double[][] b or public static double[][] subtractMatrix(double[][] a, double[][] b

In order to be add/subtract, the two matrices must have the same dimensions and the same or compatible types of elements.

1 Answer

11 votes

Answer: A

Step-by-step explanation:

User LozzerJP
by
3.4k points