I need to create an array using a constructor, add a method to print the array as a sequence and a method to fill the array with random numbers of the type double.
He
You can call the randomFill() method in a loop and fill your array in the main() method like this.
public static void main(String args[]) {
for (int i = 0; i < anArray.length; i++) {
anArray[i] = randomFill();
}
}
You would then need to use rand.nextDouble() in your randomFill() method the array to be filled is a double array. The below snippet should help you get random double values to be filled into your array.
double randomDoubleValue = rand.nextDouble();
return randomDoubleValue;