Possible Duplicate:
Create instance of generic type in Java?
I have some code:
public class foo<K> {
public void bar() {
K cheese = new K();
// stuff
}
}
This does not compile and Intellij's linter tells me Type parameter 'K' cannot be instantiated directly
.
How would I instance a new copy of K
.