Hi,
I need some help with
Java Generic Programming.
I am implementing a method that takes in some parameters and based on the parameters ,it returns a list of objects.
Now the class of these objects depends on the enum argument passed into the method.
here's my method: The parameter RiskShape is an Enum.
I want to know if it is a good idea to do this?Or is this a bad design?
Note that the code that calls the above method will also have to check for the type of objects in the list .
So
I am not sure if this is a good way to do things.
If not ,can someone please suggest a better approach.
Thanks!