March 16th, 2020
- java
- Something to watch out for in future when trying to get the parameterized type from a class, i.e the
SomeOtherClass
fromClass<SomeOtherClass>
- Getting the type is easy, especially if you only have one type:
- Something to watch out for in future when trying to get the parameterized type from a class, i.e the
|
|
- Watch out for calling
Type.getClass()
as you will not get the class you were expecting, but the class that represents the instance of theType
classType
itself is an interfaces thatClass
implements, so it should be OK to pass the type instance to places you would pass classes