399,162 views
5 votes
5 votes
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.

User Sliver
by
2.1k points

1 Answer

20 votes
20 votes

Answer: A

Step-by-step explanation:

User Radu Ursache
by
2.7k points