Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf52822

Browse files
committed
README update
1 parent dab406d commit cf52822

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

README.rst

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,16 @@ Finally, it is possible to request live results as-soon-as-possible and without
7272
7373
[8, 10, 10, 4, 0]
7474
75-
There is even a very simple way to get random numbers with the `RandomOrgRandom`.
76-
77-
You can use it like a normal `java.util.Random` but you'll get true random numbers.
78-
79-
This class manages the most stuff you need to get connected to RANDOM.ORG you only need a API-key.
75+
This library now also includes a RANDOM.ORG implementation of the `java.util.Random` class via `RandomOrgRandom`. Usage of supplied methods is similar to `java.util.Random`, with true random numbers returned or a `java.util.NoSuchElementException` exception thrown if true randomness is unavailable.
8076

8177
.. code-block:: java
8278
83-
Random ran;
84-
ran = new RandomOrgRandom(YOUR_API_KEY_HERE);
85-
System.out.println(ran.nextInt(10));
86-
System.out.println(ran.nextFloat());
79+
RandomOrgRandom ror = new RandomOrgRandom(YOUR_API_KEY_HERE);
80+
try {
81+
System.out.println(ror.nextInt(10));
82+
} catch (NoSuchElementException e) { /* fallback */ }
8783
8884
6
89-
0.6085736
9085
9186
Documentation
9287
-------------

0 commit comments

Comments
 (0)