Created
March 21, 2013 12:50
-
-
Save jangalinski/5212778 to your computer and use it in GitHub Desktop.
cannot decide what to do? Just Coin.flip() to get random 50/50 decisions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
public class Coin { | |
private static final Random random = new Random(); | |
@Deprecated | |
private Coin() { | |
// never instantiate | |
} | |
public static boolean flip() { | |
return random.nextBoolean(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment