Skip to content

Instantly share code, notes, and snippets.

@jangalinski
Created March 21, 2013 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jangalinski/5212778 to your computer and use it in GitHub Desktop.
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.
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