92
Java ThreadLocalRandom setSeed() method
The setSeed() method of Java ThreadLocalRandom class throws UnsupportedOperationException. In this generator, setting seeds is not supported. This method overrides setSeed in class Random.
Syntax:
Parameter:
seed: It is the initial seed
Exception:
UnsupportedOperationException: This exception will throw always.
Example 1
Output:
Exception in thread "main" java.lang.UnsupportedOperationException at java.base/java.util.concurrent.ThreadLocalRandom.setSeed(Unknown Source) at tests.JavaDateSetTimeExample1.main(ThreadLocalRandomSetSeedExample1.java:8)
Next TopicJava ThreadLocalRandom