You are not allowed to instantiate with a wildcard as parameter, because it is generally useless. Instead, you can just use any reference type that is within the bounds of the type parameter (in this case, there are no bounds, so just any reference type):
class SuperCrazyBogusType { }
Pair<?> p = new Pair<SuperCrazyBogusType>();
(or you can use a more normal type like Object
).
Do you see how weird that is? Yes, you can instantiate using any arbitrary type out there, even ones that have no relation to the rest of your program or what you are doing. And yes, it is 100% safe and correct, because all you wanted was a Pair<?>
(a pair of some unknown type).
That points out why it is ridiculous, and why the syntax for doing this is unnecessary. There is almost nothing you can do with the Pair<?>
you get (e.g. you cannot put any data into it), because you don't know the type parameter.