mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
Trivial implementation of java.util.Random.nextInt(int n)
This commit is contained in:
parent
e616161d5a
commit
eaa8d5c64b
@ -11,6 +11,10 @@
|
|||||||
package java.util;
|
package java.util;
|
||||||
|
|
||||||
public class Random {
|
public class Random {
|
||||||
|
public int nextInt(int n) {
|
||||||
|
return nextInt() % n;
|
||||||
|
}
|
||||||
|
|
||||||
public int nextInt() {
|
public int nextInt() {
|
||||||
return (int)(Math.random()*Integer.MAX_VALUE);
|
return (int)(Math.random()*Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user