Java Random Boolean generateRandomBoolean()

Here you can find the source of generateRandomBoolean()

Description

generate Random Boolean

License

Open Source License

Declaration

public static boolean generateRandomBoolean() 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean generateRandomBoolean() {
        return Math.random() >= 0.5;
    }//from ww  w.  jav a  2  s  . c  om
}

Related

  1. getBoolean()
  2. getBoolean()
  3. getBoolean()
  4. getBoolean()