I am currently studying and learning Java.
Now I had to hand in a delivery and used Random.nextInt(int origin, int bound)
(java.Util.Random)
.
Now it was reported back to me that my program is not compilable. (probably it was compiled with too low a version by the tester?). And that's why I searched the internet for the documentation of Random.
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html
Random
inherits from RandomGenerator
and therefore has access to nextInt(int origin, int bound)
but in the Random
class documentation nextInt(int bound)
is explicitly mentioned but nextInt(int origin, int bound)
is not. Is this because the former is overwritten by Random
?