random Boolean - Android java.util

Android examples for java.util:Random

Description

random Boolean

Demo Code


//package com.java2s;

public class Main {
    static private int randomSeed = (int) System.currentTimeMillis();

    static public final boolean randomBoolean() {
        int seed = randomSeed * 1103515245 + 12345;
        randomSeed = seed;/*from  www.ja  v a 2s .  c  om*/
        return seed > 0;
    }
}

Related Tutorials