Java Random setSeed() MethodThe setSeed() method of Random class sets the seed of the random number generator using a single long seed. SyntaxParametersseed- It is the initial seed Return ValueExample 1Test it NowOutput: Random Integer value : -1882931681 Random Integer value : -1150867590 Example 2Test it NowOutput: Error:(11, 40) java: 'void' type not allowed here The setSeed() method has a void return type, and 'void' type are not allowed in system.out.println() function.
Next TopicJava Random
|