Would it be possible to call this generic method?

Given the following method of a class which doesn't have type T defined:

public <T> T get(java.lang.String name) { /* compiled code */ }

Would it be possible to invoke this, and how?

Jon Skeet
people
quotationmark

Yes. Just call it with an explicit type argument:

 foo.<Integer>get("something")

I'm not terribly fond of how type arguments are expressed in Java, but they're perfectly doable. See the Java Generics Tutorial for another example.

people

See more on this question at Stackoverflow