I'm a beginner Java learner and I've been trying to follow the Euler Project.
I found Nayuki's solutions to the problems and I'm having difficulty wrapping my head around the need/purpose of the interface here. English isn't my first language so I'm a bit confused on what exactly is meant with the commentary of the interface here:
// This forces every solution class to implement a common interface,
// which is helpful for unit testing like in the EulerTest implementation.
public interface EulerSolution {
public String run();
}
From what I've understood, it means that instead of running every problem class one by one, I can run the interface instead and run all the classes at the same time? So I don't necessarily need this interface to solve the problems, it's just a practical way to check that they're all working how they're supposed to.
I know programming is extremely abstract but I've been struggling with this for a couple of weeks. Maybe if I can finally grasp what exactly the interface is doing behind the scenes here I'll be able to understand interfaces, their function, and how they 'fit' into an overall program and its classes more easily.
Thank you lots for any help!