Question: 2. Declare an interface called Incrementable which represents items that store an integer that can be incremented in some way. The interface bas a method
2. Declare an interface called Incrementable which represents items that store an integer that can be incremented in some way. The interface bas a method called increment that increments the value and a method called getValue that returns the value. Oace you bave written the interface, write two classes called Randomincrementer that implement the interince. The Sequentialincrementer begins its value at 0 and increases it by 1 each time it is incremented. The Randomincrementer begins its valve at random integer and changes it to a new random integer each time it is incremented ter and Write a client class that creates objects of the two classes and prints out the valoes before calling the increment method and after calling the method. Call the increment method multiple times and print out the values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
