I have a class
public abstract class FakeClass<T extends MyClass> {
protected HashMap<Character, T> myMap;
private void myMethod(){
myMap.put('c', /*???? I need to instatiate something of type T here.*/)
}
}
As you can see, I can't figure out how to instantiate something of type T. Is this possible? If so can someone point me in the right direction to do it?
Thanks!
MyClassisn't always going to matchT extends MyClass. What would be helpful is some context as to what that map is going to be used for.