This is a Java project that demonstrates the use of classes and inheritance to create different types of counters. The project includes three classes: Counter
, StepCounter
, and ModNCounter
, each with its unique behavior and features.
To use this project, you can follow these steps:
-
Clone the repository to your local machine using Git:
git clone https://github.com/kathleenforgiarini/java_counters.git
-
Open the project in your preferred Java development environment (IDE).
-
Run the CounterTester1 class to test and demonstrate the functionality of the counter classes.
- bus package contains the counter classes (Counter, StepCounter, ModNCounter).
- client package contains the CounterTester1 class to test and demonstrate the counter classes.
- Counter: The base class representing a simple counter with the ability to increment, decrement, and reset.
- StepCounter: Extends Counter and adds a step value for each increment and decrement operation.
- ModNCounter: Extends Counter and resets to a specific value (1 by default) when reaching a maximum limit.
You can refer to the example output in the comments section of the CounterTester1 class to see how the counters behave and their interactions.
This project is for educational purposes and demonstration. Contributions are welcome if you have suggestions or improvements. Feel free to fork the repository, make your changes, and create a pull request.
This project is not currently licensed. It is for educational purposes and demonstration only. Use it as a reference and exercise in object-oriented programming.
If you have any questions or feedback, you can reach out to me:
- Kathleen
- Linkedin: https://www.linkedin.com/in/kathleenforgiarini/
- GitHub: https://github.com/kathleenforgiarini