Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.ThreadLocalRandom; public class ThreadLocalRandomNextLongExample6 { public static void main(String[] args) { // Returns exception because the bound is negative System.out.println("Random long value is: " + ThreadLocalRandom.current().nextLong(-10000)); } }
Output