Methods do not work. How to be right?
public class Dice{ public static void main( String[] args){ // constants // variables Die die1; Die die2; die1 = new Die(); die2 = new Die(); } // program code public int rollDice(){ die1.roll(); die2.roll(); return die1.getFaceValue() + die2.getFaceValue(); } public int getDie1FaceValue(){ return die1.getFaceValue(); } public int getDie2FaceValue(){ return die2.getFaceValue(); } public int getDiceTotal(){ return die1.getFaceValue() + die2.getFaceValue(); } public String toString(){ return "Die face number is"; } } where, roll () is a method in the Die class that gives a random number from 1 to 6; getFaceValue () is a method in the Die class that returns this number.