https://github.com/amadr-95/java-abstract
Abstract class example
https://github.com/amadr-95/java-abstract
abstract-classes java
Last synced: 12 months ago
JSON representation
Abstract class example
- Host: GitHub
- URL: https://github.com/amadr-95/java-abstract
- Owner: amadr-95
- Created: 2023-08-13T10:06:18.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-25T18:14:40.000Z (about 2 years ago)
- Last Synced: 2025-03-22T06:17:46.294Z (over 1 year ago)
- Topics: abstract-classes, java
- Language: Java
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NumberExtractorReport
This class allow us to extract only the data from the file
that matches a given pattern, which in this case
is for phone numbers.
However, we can enhance this class by making it **abstract**.
This class will implement an abstract method that will be filled in
by subclasses depending on the type of data required to be reported
(phone numbers, emails, names, etc.).
This approach is a much better implementation because it:
- Avoid code duplication
- Increases resusability
- Encapsulate a common functionality in one place
- Let subclasses implement specific body methods for their purposes

To see that implementation change to branch [_abstract_](https://github.com/amadr-95/java-master-abstract-example/tree/abstract)