code: public static double[] repeat (double value, int n) {
          // Initialize the return array:
          double[] retval = new double[n];
  
          // Fill the array:
          Arrays.fill(retval, value);
  
          // Done, return the filled array:
          return retval;
      }
docs: Creates and returns an array of length {@code n} with all values set to {@code value}.
  
  @param value The value to be filled.
  @param n The desired length of the array.
  @return An array of length {@code n} with all values set to {@code value}