Question
use java to solve this Implement a small class named Digit that represents a base-10 digit (an integer value between 0 and 9, inclusive). Your
use java to solve this
Implement a small class named Digit that represents a base-10 digit (an integer value between 0 and 9, inclusive). Your class should have the following features: the value of the digit is guaranteed to always be between 0 and 9, inclusive the user of the class can create a Digit from an int value the user of the class can ask the Digit class for a random Digit object random means that your method should return all possible Digit objects with approximately equal probability the user of the class can get the value of a Digit object as an int value the user of the class can increment the value of Digit object (increasing its value by 1) incrementing the Digit whose value is 9 causes the value to become 0 (i.e., the value wraps around) the toString method returns a string containing the integer value of the Digit Your class does not require an equals or hashCode method. Your class does not require Javadoc. Your class should use the principles of encapsulation and information hiding.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started