Question: Here is a main program that doesnt work because the class it is using hasnt been written. Write a complete definition for the missing class
Here is a main program that doesnt work because the class it is using hasnt been written. Write a complete definition for the missing class that will allow the program to run correctly.
public class Main {
public static void main(String[] args) {
Dice d = new Dice();
System.out.println(d); // Print dice, initially (1)
d.roll(); // Assigns a random value 1 to 6
System.out.println(d) ; // Prints current value of dice
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
