class MatrixApplication1 { public static void main(String args[]) { Random rand = new Random(); int n=4; Matrix A1=new DenseMatrix(n,rand); System.out.println("Matrix A1 in Dense Format\n"); A1.print(); //Change Elements (3,0) (2,1) (1,2) (0,3) A1.set(3,0,1.0); A1.set(2,1,2.0); A1.set(1,2,3.0); A1.set(0,3,4.0); System.out.println("Matrix A1 after changes\n"); A1.print(); System.out.println("Print diagonal elements of A1\n"); //// one could do // for (int i=0;i