Suppose class A has many subclasses B, C, D,... (the names can be very irregular).
Is there a way to implement a mathod
public static newInstance(String xml)
in class A such that when I say
B.newInstance(anXml), the method in A will be invoked and returns an object of type B,
while C.newInstance(aValue) will invoke the same method but returns an object of type C?
Thanks for your help