Question: Part | -- Matrix (85 pts) Complete the following interface for the Matrix class and save it as Matrix.java. You may add additional methods at






Part | -- Matrix (85 pts) Complete the following interface for the Matrix class and save it as Matrix.java. You may add additional methods at your convenience. public class Matrix // Creating the data fields that include an integer for row, // and integer for column, and a two-dimensional array of // type integer for the matrix elements. protected int row; // Matrix row protected int column; // Matrix column protected int [ ] [ ]data; // 2D array // Default constructor public Matrix() row = 0; column = 0; // Accessing element at position i,j public int getData(int i, int j) return data[i][j]; // Changing matrix element at position i,j public void setData(int i, int j, int value) data[i][j] = value; // Create a constructor that takes a 2D array // of integers (i.e: int[ ] array), and the // class attributes should be modified accordingly. public Matrix(int (1) array) /* YOUR CODE HERE :/ Part | -- Matrix (85 pts) Complete the following interface for the Matrix class and save it as Matrix.java. You may add additional methods at your convenience. public class Matrix // Creating the data fields that include an integer for row, // and integer for column, and a two-dimensional array of // type integer for the matrix elements. protected int row; // Matrix row protected int column; // Matrix column protected int [ ] [ ]data; // 2D array // Default constructor public Matrix() row = 0; column = 0; // Accessing element at position i,j public int getData(int i, int j) return data[i][j]; // Changing matrix element at position i,j public void setData(int i, int j, int value) data[i][j] = value; // Create a constructor that takes a 2D array // of integers (i.e: int[ ] array), and the // class attributes should be modified accordingly. public Matrix(int (1) array) /* YOUR CODE HERE :/
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
