public class Matrix2x2 private double matrix new double public Matrix2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
public class Matrix2x2 {
private double[][] matrix = new double[2][2];
public Matrix2x2() {
this(new double[][]{{0, 0}, {0, 0}});
}
public Matrix2x2(double element){
this(new double[][]{{element, element}, {element, element}});
}
public Matrix2x2(double[][] matrix){
this.matrix = matrix;
}
public Matrix2x2(double first, double second, double third, double fourth){
this(new double[][]{{first, second}, {third, fourth});
}
}