Question: construct a class called Toothbrush in JAVA , representing an electric toothbrush, with attributes being the brand, the color (using Color class), and the softness

construct a class called Toothbrush in JAVA , representing an electric toothbrush, with attributes being the brand, the color (using Color class), and the softness hard, medium, soft. Methods required include a default constructor with no arguments, a constructor with all arguments, all getter and setter methods, and a toString method. There is also a brushTeeth method which uses a random generator to determine how many seconds of brushing there will be, between 100 and 1000. Write a TestToothbrush program to create 3 objects of type Toothbrush and to test all getter methods, toString method, and brushTeeth method in the Toothbrush object.

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!