
Simple java program to generate random numbers - frndslink
http://frndslink.in/java/simple-java-program-generate-random-numbers/
======
Alupis
Not to harp, but your set is better defined as [0, 100), that is, [0, 99], not
the [1, 100] you mention in the article.

nextInt(int):

    
    
        Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)
    

[https://docs.oracle.com/javase/7/docs/api/java/util/Random.h...](https://docs.oracle.com/javase/7/docs/api/java/util/Random.html#nextInt\(int\))

~~~
davelnewton
More or less what I said, I think.

------
davelnewton
So now you're just posting links to all your articles to... drive traffic? I
mean, it's not even _correct_ \--it will print out random ints from 0-99, just
like it says in the `int nextInt(int)` Javadocs.

:(

------
davelnewton
After corrections it's still wrong: as discussed, it will return 0-99.

------
davelnewton
How did this get upvotes.

