Java Random nextGaussian() MethodThe nextGaussian() method of Random class returns the next pseudorandom, Gaussian(normally) distributed double value with mean 0.0 and standard deviation 1.0 from the random number generator's sequence. SyntaxParametersNA Return ValueThe nextDouble() method returns the next pseudorandom Gaussian distributed double number with mean 0.0 and standard deviation 1.0. Example 1Output: Random Gaussian value : -3.3518483633913014 Random Gaussian value : -1.3767908077736486 Example 2Test it NowOutput: -0.7001112567605307 -1.0015898772831247 -0.8454172962601406 0.12805541404557777 -0.8336655342786383 Example 3Test it NowOutput: Enter the number of Visitors.4 Enter the name of 4 students. 1 Reema 2 Ravi 3 Rahul 4 Sonia Sorry! Reema you are out of the game. Congratulations! Ravi you are in the game. Sorry! Rahul you are out of the game. Sorry! Sonia you are out of the game. Next TopicJava-random-nextint-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India