Which statement creates a low-overhead, low contention random number generator that is isolated to a thread to generate a random number between 1 and 100?
A. int i = ThreadLocalRandom.current().nextInt (1, 101);
B. int i = ThreadSaferandom.current().nextInt(1, 101);
C. int i = (int) Math.random()*.nextInt(1, 101);
D. int i = (int) Match.random (1, 101); E. int i = new Random (). nextInt (100)+1;
Which statement creates a low-overhead, low contention random number generator that is isolated to a thread to generate
-
- Site Admin
- Posts: 899559
- Joined: Mon Aug 02, 2021 8:13 am