I want to know what will happen to the array using this.
double [] array = new double[] {0}
does it initialize an array that all of its elements are zero? and if so what will the length of the array be.
I want to know what will happen to the array using this.
double [] array = new double[] {0}
does it initialize an array that all of its elements are zero? and if so what will the length of the array be.
The given line initializes a double array. There are 2 ways to initialize an array: new double[arrayLength] or new double[]{arrayContents}. The given code uses the second solution, so it creates a new double array with a single number (which is 0).