挺简单的代码,自己看吧~~ //骰子类import java.util.Scanner;public class die { private int faceValue; private int maxValue; private int badnumber; public void setMaxValue(int maxValue){ this.maxValue = maxValue; } public void ro
//骰子类 import java.util.Scanner; public class die { private int faceValue; private int maxValue; private int badnumber; public void setMaxValue(int maxValue){ this.maxValue = maxValue; } public void rolling(){ this.faceValue = (int) (Math.random()*maxValue+1); } public void setBadNumber(int badnumber){ this.badnumber = badnumber; /* int[] bad= new int[5]; Scanner in = new Scanner(System.in); for(int i=0;i