In Java, if I have:
public class Foo<T> {
public Foo() { }
}
I can do Foo<Integer> foo = new Foo<Integer>();
but I cannot find an equivalent syntax for using the class
field, meaning that something like Foo<Integer> foo = Foo<Integer>.class.newInstance();
doesn't work. Is there a way to use generics via the newInstance method?