:

/* Decrement this Counter.
*/
void decrement();
/* Reset this Counter.
*/
void reset();
}
Implementing the classes:
A common structural pattern is to define an abstract class that implements an interface,
defines data common to all interface implementations, and provides some default method
implementations. Concrete classes can then extend the abstract class:
We will define an abstract class
AbstractCounter
that inherits the abstract methods of the
interface
Counter
and defines an
int
component variable to contain the value of the
counter. The abstract class also defines a constructor that initializes the value to 0. The
