public static Matrix<Element> getRest(int row, int col, Element[][] matrix)
  { if(matrix!=null)
    { int m=matrix.length; 
      int n=matrix[0].length;   
      if(row>=0 && col>=0 && row<m && col<n)
      { if(row==m-1 || col==n-1)
        { return null;
        }  
        else
        { Element[][] res=new Element[m-1-row][n-1-col];
          for(int i=0;i<m-1-row;i++)
          { for(int j=0;j<n-1-col;j++)
            { res[i][j]=matrix[row+1+i][col+1+j];  
            }  
          }
          return new Matrix(res);
        }
      }
      else
      { throw new RuntimeException("Invalid value row="+row+" and col="+col);
      } 
    }
    else
    { return null;
    }  
  }