// bad way to generate booleans import java.util.Random; // ... static Random wheel = new Random(); // ... boolean heads = ( wheel.nextInt() & 1 ) != 0; // not recommended!!