Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.ThreadLocalRandom; public class ThreadLocalRandomNextIntExample6 { public static void main(String[] args) { // Returns exception because least is greater than bound System.out.println("Random int value is: " +ThreadLocalRandom.current().nextInt(30, 10)); } }
Output