Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
*/
public class RandomTools {

private static final Random r = new Random();

/**
* Calculates a random integer between two integer values
* @param low The first integer
* @param high The second integer
* @return The random integer between low and high, inclusive
*/
public static int betweenTwoNumbers(int low, int high) {
Random r = new Random();
return r.nextInt(high - low + 1) + low;
}
}
Loading