How to use an interface/something similar to clean up duplicate code in Java
I have output functions that output data from different objects to their corresponding files. Most of these functions follow the same pattern, the only differences are the objects being used and by …