float minX = 50.0f; float maxX = 100.0f; Random rand = new Random(); float finalX = rand.nextFloat(maxX - minX + 1.0f) + minX;
\"The method nextFloat
It should read like the following as others are suggesting.
float finalX = rand.nextFloat(); // do other stuff