Answers for "java get a random int"

1

java get random

// Thread safe random number generator.

import java.util.concurrent.ThreadLocalRandom;



// Generate random integers  
int val = ThreadLocalRandom.current().nextInt();  

// Print random int
System.out.println("Random Integer: " + val);
Posted by: Guest on June-21-2021
3

random numbers java

int random = (int) (Math.random()*(max-min+1)+min);
Posted by: Guest on January-03-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language