Random setSeed() method in Java with Examples
The setSeed() method of Random class sets the seed of the random number generator using a single long seed.
public void setSeed()
Parameters: The function accepts a single parameter seed which is the initial seed.
Return Value: This method has no return value.
Exception: The function does not throws any exception.
Program below demonstrates the above mentioned function:
Random Integer value : -2053473769 Random Integer value : -1152406585
Random Integer value : -388369680 Random Integer value : -1154330330
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.