Question: Hello, I have a question regarding my get function as it doesen't seem to be working, thanks! package matrix; import java.util.List; import java.util.ArrayList; /** *
Hello, I have a question regarding my get function as it doesen't seem to be working, thanks!
package matrix;
import java.util.List; import java.util.ArrayList;
/** * This class provides a data representation for the AbstractMatrix * implementation of the Matrix API. * It uses a list of list of integers to store matrix elements. */ public class ArrayListImplementation extends AbstractMatrix {
/** * Creates a list representation of a matrix of integers. * Elements of the list are initialized to zero. * @param numRows the number of rows in the matrix * @param numColumns the number of columns in the matrix * @throws MatrixException if dimensions are not positive */ public ArrayListImplementation(int numRows, int numColumns) { // You must provide super.setNumRows(numRows); super.setNumColumns(numColumns); elements = new ArrayList<>(numRows); for (int i=0; i < numRows; i++) { elements.add(new ArrayList> elements; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
