Java ThreadLocalRandom setSeed() methodThe 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 1Test it NowOutput: 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
|