Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.ThreadLocalRandom; public class ThreadLocalRandomNextLongExample2 { public static void main(String[] args) { // Returns a pseudorandom, uniformly distributed long value between 0 and 2000 System.out.println("Random long value is: " + ThreadLocalRandom.current().nextLong(2000)); } }
Output