class Matrix3x3 { double[] elements; Matrix3x3(double... elements : {1,0,0, 0,1,0, 0,0,1}) { if(elements.length != 9) throw new IllegalArgumentException(); this.elements = elements; } } Matrix scaleDouble = new Matrix(elements[1,4,8]: 2.0);