import java.util.Random; public static float randFloat(float min, float max) { Random rand = new Random(); return rand.nextFloat() * (max - min) + min; }