float minX = 50.0f; float maxX = 100.0f; Random rand = new Random(); float finalX = rand.nextFloat(maxX - minX + 1.0f) + minX;
\"The method nextFloat
The nextFloat method doesn't take an argument. Call it, then scale the returned value over the range you want.
float minX = 50.0f; float maxX = 100.0f; Random rand = new Random(); float finalX = rand.nextFloat() * (maxX - minX) + minX;