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