Question: My program does not compile need help. thank you. Write a Java class that represents a six-sided dice. The class will have a no-arg (without

My program does not compile need help. thank you.

My program does not compile need help. thank you. Write a Java

Write a Java class that represents a six-sided dice. The class will have a no-arg (without arguments) constructor. The dice will have a method public void cast () }. The cast method, when invoked, will set the internal state of the dice with a random number between 1 and 6 . When printed the dice will display its random value. Dice d= new Dice(); d. cast(); System.out.println (d) ; The output will be: The value is: 6 The number will remain the same until the cast method is called again. This article shows how to generate random numbers in Java. https://www.geeksforgeeks.org/generating-random-numbers-in-iava/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!