Hi,
I have a Factory class for creating various objects.
The API is like this:
public static <T extends BusinessEntity> T createEntity(Class<T> t)
The usage is as:
Car car = Factory.create(Car.class);
Notice I have to specy the class type as a parameter.
I note with things like the collections framework, I don't have to specify a class parameter. For example, I can just do
List<Car> cars = new ArrayList<Car>();
I was wondering is there anyway I can improve my Factory method, so I don't have to specify a .class parameter.
Thanks a million.