Java Random nextDouble() MethodThe nextDouble() method of Random class returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence. SyntaxParametersNA Return ValueThe nextDouble() method returns the next pseudorandom double number between 0.0 and 1.0. Example 1Test it NowOutput: Random Double value : 0.9331473599874305 Random Double value : 0.3410043816871041 Example 2Test it NowOutput: 0.7826712054759732 0.9263394699584369 0.4685457032740772 0.40580525304253123 0.9551940609374556 Example 3Test it NowOutput: Enter number of students.2 Enter name of 2 students. 1 Reema 2 Saloni 1. Reema'sid : 0.1132984792177768 2. Saloni'sid : 0.8604571338175745
Next TopicJava Random
|