Why there is no nextDouble(), nextFloat() and nextLong() which accept a bound in java.util.Random

Viewed 1021

I was reading java.util.Random class and noticed that there is no nextDouble(), nextFloat() and nextLong() which can accept a bound.

There are many way to get it done like this.

But my question is why java did not provide us with these required method like nextInt(int n) which accept the bound.

Is there any specific reason they did not provide these methods?

2 Answers
Related