MVi
public java v1 · immutablepublic Dice{ private int throw1; private int throw2; public Dice() { Random rand = new Random(); throw1 = rand.nextInt(6) +1; throw2 = rand.nextInt(6) +1; } public int total() { return throw1 + throw2; } public bool doubles() { return throw1 == throw2; }}