Question: Task 3. Implementation of MyMatrixException class In this part you are asked to create your own exception class. (a) Create new class as MyMatrixException extending

 Task 3. Implementation of MyMatrixException class In this part you are

Task 3. Implementation of MyMatrixException class In this part you are asked to create your own exception class. (a) Create new class as MyMatrixException extending the class Exception. Provide a constructor for the new class as public MyMatrixException (String msg) , which calls the parent class constructor with msg parameter. (b) An array parameters are valid inputs to a public MyMatrix method if and only if it is a square array of type double [n] [n ] with n > 0 and dimensions are compatible for binary operations. For all the relevant public methods in MyMatrix class add all the necessary code to check for non-valid input, throwing a MyMatrixException with message "Input is null", "Input is not a square matrix" or "Input matrices have different dimensions" as appropriate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!