Question: Given Die class (Die.java), write a program that instantiates two Die objects and rolls them repeatedly until they are equal (use equals() or compareTo() method).


Given Die class (Die.java), write a program that instantiates two Die objects and rolls them repeatedly until they are "equal" (use equals() or compareTo() method). The program prints the number of times both dice landed on an odd number. Die.java \( \begin{array}{l}\text { It uunzad } \\ \text { laseduo// } \\ \text { \{aje }\} \text { an[enaje }\{ \\ \text { \}(ajef zuT) an[enajefzas pon qnd } \\ \text { 77s// } \\ \text { San[eney usmad } \\ \text { \} ()an[aje 8. 7ut ot[qnd } \\ \text { 778// } \\ \text { [0.// } \\ \begin{array}{l}\text { \{ajey = an[enajef } \\ \text { (ajef quT) aa o [qnd }\end{array} \\ \text { 07ondzsuos } 7 \text { [nefap-uou // } \\ \text { dozondzsuos 7[nefop/l } \\ \text { suot7edado// } \\ \text { sanqe// } \\\end{array} \)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
