Given a public class named DryEraseMarker which contains: •   two private data member variables named inkColor which is of type Color and length which of type int.•   a constructor that does not take any parameter but it initializes the member variable inkColor to Color.BLACK and the member variable length to 8.•   five public methods: two mutators (both void type) named setInkColor and setLength, two accessors named getInkColor which is of type Color and getLength which is of type int, and a write method which is of type void.•   the mutator method setInkColor which is type void accepts one parameter named anotherColor which is of type Color and assigns the member variable inkColor to anotherColor.•   The mutator method setLength which is of type void accepts one parameter named anotherLength which is of type int and assigns the member variable length to anotherLength.•   the accessor method getInkColor which is of type Color does not accepts any parameter but it returns the member variable inkColor.•   the accessor method getLength which is of type int does not accepts any parameter but it returns the member variable length.•   the method write which is of type void accepts one String parameter named message and prints message on the console using System.out.println. Using the above specification write the complete implementation (Java program) of the public class DryEraseMarker.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 13PE
icon
Related questions
Question

Given a public class named DryEraseMarker which contains:

•   two private data member variables named inkColor which is of type Color and length which of type int.
•   a constructor that does not take any parameter but it initializes the member variable inkColor to Color.BLACK and the member variable length to 8.
•   five public methods: two mutators (both void type) named setInkColor and setLength, two accessors named getInkColor which is of type Color and getLength which is of type int, and a write method which is of type void.
•   the mutator method setInkColor which is type void accepts one parameter named anotherColor which is of type Color and assigns the member variable inkColor to anotherColor.
•   The mutator method setLength which is of type void accepts one parameter named anotherLength which is of type int and assigns the member variable length to anotherLength.
•   the accessor method getInkColor which is of type Color does not accepts any parameter but it returns the member variable inkColor.
•   the accessor method getLength which is of type int does not accepts any parameter but it returns the member variable length.
•   the method write which is of type void accepts one String parameter named message and prints message on the console using System.out.println.

Using the above specification write the complete implementation (Java program) of the public class DryEraseMarker.

 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,