Javatpoint Logo
Javatpoint Logo

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

Test it Now

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)






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA