dimanche 1 mai 2016

What is generic factory and how to implement it in a factorial program

I implemented a simple program in Java to calculate the factorial of a given number in both recursive and iterative methods. I used an interface Factorial which is implemented by 2 classes FactorialRecursive and FactorialIterative. Now I would like to implement a Generic factory which can discover and instantiate possible implementations for any given interface class. Can anyone explain in simple words what is the Generic factory? Is it the same as the generics?

Aucun commentaire:

Enregistrer un commentaire