Get random boolean in Java

后端 未结 10 1569
情深已故
情深已故 2020-12-01 11:28

Okay, I implemented this SO question to my code: Return True or False Randomly

But, I have strange behavior: I need to run ten instances simultaneously, where every

10条回答
  •  生来不讨喜
    2020-12-01 12:08

    You could also try nextBoolean()-Method

    Here is an example: http://www.tutorialspoint.com/java/util/random_nextboolean.htm

提交回复
热议问题