Java Random nextBoolean() MethodThe nexBooleant() method of Random class returns the next pseudorandom, uniformly distributed boolean value from the random number generator's sequence. SyntaxParametersNA Return ValueThe nextBoolean () method returns the next pseudorandom boolean value. Example 1Output: Random booleanvalue : false Random booleanvalue : true Example 2Output: For Head: enter true. For tail : enter false Enter your choice : false Outcome is : false Congratulations!!You won the round! Next TopicJava-random-nextbytes-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