I have class similar as given below
public class MyClass<K,V>{
public MyClass(Properties prop){
Map<K,V> myMap = new HashMap<K,V>();
}
}
I need to invoke this class by passing String
as K
and V
as MyAnotherClass
, but the MyAnotherClass
will be taken as an user input through file, how to create the MyAnotherClass
from a given name from file, and pass the same to
MyClass<String,MyAnotherClass> = new MyClass<String,MyAnotherClass>()
. what is the best way to achieve the same.
Any help would be appreciated.
Thanks