Generating a random double between x and y

You can use the formula:

   lowerbound + ((upperbound - lowerbound) * randomdouble)

To get a random double number, instantiate a Random object and call the method nextDouble which returns a pseudo-random float between 0 and 1.

Main.java:

import java.util.*;
  
public class Main {   
   static Random r = new Random();
 
   public static void main(String[] args) throws Exception {
  
      for (int i=0; i<10; i++) 
         System.out.println(getRandomDouble(-10, 15));
   }
 
   public static double getRandomDouble(double min, double max) {
      return min + (r.nextDouble() * (max - min));
   }
}

outputs:

-8.27577613957078
7.8901509288709875
9.692495759967983
-6.980121699011098
6.601079261644884
-9.471052403758076
4.7473270087607045
12.034529118113905
9.762114133902635
-9.449081692716046