I just noticed there's a Method.getGenericReturnType()
as well as Method.getReturnType()
and similar pairs for exception types and parameter types.
I thought generics in Java worked via type erasure. So how would these methods work at runtime? (and what would I use them for at runtime?)